Skip to content

A small helper library to use with SQLite, Dapper, FluentMigrator, and AutoMapper.

License

Notifications You must be signed in to change notification settings

kalilistic/FluentDapperLite

Repository files navigation

FluentDapperLite

Nuget

A small helper library to use with SQLite, Dapper, FluentMigrator, and AutoMapper.

Features

  • Provide SQLite FluentMigrator Runner with common PRAGMA settings and normalized version naming scheme.
  • Provide base data repository class providing fundamental methods for data access with AutoMapper.
  • Provide FluentMigrator & Dapper extensions for UInt16, UInt32, and UInt64 column types.
  • Provide utility to check if a file is a valid SQLite database based on its binary signature.
  • Provide FluentMigrator extensions for adding standard 'Id' and timestamp columns.

Example

// Check if valid SQLite database
bool isValid = SQLiteFileValidator.IsValidDatabase(dataSource);

// Run FluentMigrator to execute migrations found in calling assembly
SQLiteFluentMigratorRunner.Run(dataSource);

// Build database connection
var databse = SQLiteDbConnectionBuilder.Build(dataSource);

// Build mapper with AutoMapper profile
var mapper = new MapperConfiguration(cfg =>
{
    cfg.AddProfile<MyProfile>();
}).CreateMapper();

// Build repository that inherits from BaseRepository
var myRepository = new MyRepository(database, mapper);

About

A small helper library to use with SQLite, Dapper, FluentMigrator, and AutoMapper.

Topics

Resources

License

Stars

Watchers

Forks

Languages