如何在Xamarin Forms项目中使用Couchbase.Lite-PCL? [英] How to use Couchbase.Lite-PCL in a Xamarin Forms project?

查看:157
本文介绍了如何在Xamarin Forms项目中使用Couchbase.Lite-PCL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看到nuget中有一个Couchbase.Lite-PCL,它最近已发布.这可以在PCL中运行吗?任何人都知道如何使其工作吗?我找不到关于此的任何文档.

I see there's a Couchbase.Lite-PCL in nuget which has been published recently. Is this capable of running in the PCL? Anyone knows how to make it work? I couldn't find any documentation on this.

推荐答案

它不是正式的NuGet软件包,因此您的里程可能会有所不同.

It is not an official NuGet package, so your milage may vary.

该dll确实位于可移植文件夹中,并且该dll可以很好地添加到PCL中,并且该项目似乎可以构建.

It does have the dll's in a portable folder, and the dll's are added fine to a PCL and the project seems to build.

尝试一下,它可能工作正常,但是不要期望沙发上的人会提供任何直接支持.

Try it it, it might work fine, but don't expect any direct support from the couchbase people.

或者,您可以在PCL中实现一个接口,您可以使用官方的Couchbase nuget中所需的方法在每个平台上实现该接口.然后在运行时通过Xomarin.Forms提供的IoC容器注入特定于平台的实现.

Alternatively you could implement an Interface in your PCL, which you implement per platform with the methods you need from the official couchbase nuget. Then inject that platform specific implementation at runtime through the IoC container Xamarin.Forms provide.

这篇关于如何在Xamarin Forms项目中使用Couchbase.Lite-PCL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆