RepoDb is an open-source .NET ORM that bridge the gaps between micro-ORMs and full-ORMs. It helps the developer to simplify the switch-over of when to use the BASIC and ADVANCE operations during the development.
It is the best alternative ORM to both Dapper and EntityFramework.
- GitHub Home Page - to learn more about the core library.
- Website - docs, features, classes, references, releases and blogs.
- GitHub - for any issues, requests and problems.
- StackOverflow - for any technical questions.
- Twitter - for the latest news.
- Gitter Chat - for direct and live Q&A.
- RepoDb - the core library of RepoDb.
- System.Data.SQLite - the data provider used for SqLite.
Apache-2.0 - Copyright © 2019 - Michael Camara Pendon
At the Package Manager Console, write the command below.
> Install-Package RepoDb.SqLite
Or, visit our installation page for more information.
First, the bootstrapper must be initialized.
RepoDb.SqLiteBootstrap.Initialize();
Note: The call must be done once.
After the bootstrap initialization, any library operation can then be called.
Or, visit the official get-started page for SQLite.
using (var connection = new SQLiteConnection(ConnectionString))
{
var customer = connection.Query<Customer>(c => c.Id == 10045);
}
var customer = new Customer
{
FirstName = "John",
LastName = "Doe",
IsActive = true
};
using (var connection = new SQLiteConnection(ConnectionString))
{
var id = connection.Insert<Customer>(customer);
}
using (var connection = new SQLiteConnection(ConnectionString))
{
var customer = connection.Query<Customer>(10045);
customer.FirstName = "John";
customer.LastUpdatedUtc = DateTime.UtcNow;
var affectedRows = connection.Update<Customer>(customer);
}
using (var connection = new SQLiteConnection(ConnectionString))
{
var customer = connection.Query<Customer>(10045);
var deletedCount = connection.Delete<Customer>(customer);
}