Using the CouchBaseLite-Plugin for MvvmCross is quite simple. The plugin injects the ICouchBaseLite interface into the IoC container.
Project | Nuget |
---|---|
CouchBase | |
CouchBase with SQLCipher | |
CouchBase with ForestDB |
Install MvvX.CouchBaseLite from nuget.
Important: You will need to add the nuget package to both your PCL project and your platform-dependent project.
This is an open source project that welcomes contributions/suggestions/bug reports from those who use it.
If you have any ideas on how to improve the library, please post an issue here on github. Please check out the How to Contribute.
The API of ICouchBaseLite is very easy to understand and to use.
public interface ICouchBaseLite : IDisposable
{
IDatabase Database { get; }
bool CreateConnection(string workingFolderPath, string databaseName);
}
Using the name of the database and the folder on the client device where to store database files:
ICouchBaseLite service = Mvx.Resolve<ICouchBaseLite>();
var databaseName = "MvvXPluginTest";
var databaseFolderPath = Path.Combine(Path.GetTempPath(), "testCouchDb");
// Connect to the database
var successConnection = service.CreateConnection(databaseFolderPath, databaseName);
To be complete...