Painless Sqlite

Painless Sqlite

Better than barebones SQLite, but not quite Entity Framework.

This is Painless Sqlite, for those who think that one’s too bare, and that other one’s too hairy!

Install

Add Nuget Package Pianoware.PainlessSqlite (Pre-release)

PM> Install-Package Pianoware.PainlessSqlite -Pre

Usage

Inherit from SqliteContext and add fields and/or properties of type SqliteSet<TModel> where TModel is your model type:

class MyContext : SqliteContext 
{
    public SqliteSet<Employee> Employees;
}

class Employee 
{
    public long Id;
    public string Name;
}

That’s it folks! Now use it like so:

using (var myContext = new MyContext()) 
{
    myContext.Employees.Add(new Employee { Name = "Arash Motamedi" });
    foreach (var employee in myContext.Employees)
    {
        GiveRaiseTo(employee); // ;) 
    }
}

What it is

What it isn’t

Support or Contact

This library is provided for your convenience and pleasure and inspiration. If you have any questions or suggestions, email me at arash.motamedi@gmail.com. Contributions that keep with the spirit of the library - lightweight and straightforward - will be greatly appreciated.