a library with easy CRUD operations for Dapper.
Dommel consists of a set of extension methods on the IDbConnection
interface which provides CRUD operations. The generated SQL queries are executed and mapped to objects by Dapper.
Dommel has support for selecting entities by id or all entities in a table and insert, update and delete queries. See the API section of the docs for more.
Some code examples:
using (var con = new SqlConnection())
{
var product = con.Get<Product>(1);
var products = con.GetAll<Product>();
con.Insert(new Product { Name = "Bike", InStock = 4 });
product.LastUpdate = DateTime.Now;
con.Update(product);
con.Delete(product);
}
There are also certain extensibility points available, allowing you override the process of resolving properties and the key property of an entity, table name and column names. Also see the docs.
Query builders allow you to add custom query generation functionality for certain a RDBMS.
The Dommel extension of Dapper.FluentMap makes use of the extensibility of Dommel by implementing the resolver interfaces. This allows you to fluently map your POCO entities to the underlying database.