Skip to content
This repository has been archived by the owner on Jan 19, 2025. It is now read-only.

Latest commit

 

History

History
33 lines (25 loc) · 1.44 KB

README.md

File metadata and controls

33 lines (25 loc) · 1.44 KB

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);