Depending on application's requirements, you might need a local data storage to keep the data locally for offline use. The common local storage available in most mobile platforms is SQLite (https://sqlite.org/). Typically, each platform uses different way to perform data operation to SQLite which increasing technical difficulties and complexity when developing mobile apps.
With Crosslight you can perform data operation to SQLite easily and elegantly, thanks to the comprehensive and intuitive API which are engineered from the ground up for cross-platform support. It also supports LINQ query to SQLite along with extensions to use Crosslight QueryDescriptor. For more information about QueryDescriptor, see Understanding Query Descriptor.
Introducing Crosslight SQLite
Unlike other SQLite implementation, Crosslight SQLite is built from the ground up with modern design patterns to support advanced features such as asynchronous API, LINQ, and automatic changes and version management. And the best of all, you can consume SQLite directly from the ViewModel in the portable shared project, making it the industry's first cross-platform SQLite implementation.
Implemented with abstraction pattern, you can easily work with Crosslight SQLite by obtaining a new instance of ISQLiteConnection through the IActivatorService. In addition, you typically use the SQLite service in conjunction with local storage service which is responsible to manage file access to the device storage. For more information about local storage, see Working with Local Device Storage.
At the simplest, you can use the following code to retrieve data with Crosslight SQLite.
To use Crosslight SQLite in your projects, you need to add references to the Intersoft.Crosslight.Data.SQLite assembly in the Core project as well as the platform-specific SQLite assembly respectively. There are no extra configurations required in the platform-specific projects since the SQLite services will automatically initialize itself during startup. All you need to do is simply adding the assembly references properly.
To see the list of Crosslight assemblies, refer to Redistributable Assemblies.
The following topic guides you how to use Crosslight SQLite to perform data operations on SQLite.