diff --git a/README.md b/README.md index 8c81d1d..08733c3 100644 --- a/README.md +++ b/README.md @@ -102,3 +102,49 @@ public class PropertyTransformConvention : Convention ``` This configuration will map camel case property names to underscore seperated database column names (`UrlOptimizedName` -> `Url_Optimized_Name`). + +
+ +### [Dommel](https://github.com/HenkMollema/Dommel]) +Dommel contains a set of extensions methods providing easy CRUD operations using Dapper. One of the goals was to provide extension points for resolving table and column names. [Dapper.FluentMap.Dommel](https://github.com/HenkMollema/Dapper-FluentMap/tree/master/src/Dapper.FluentMap.Dommel) implements certain interfaces of Dommel and uses the configured mapping. It also provides more mapping functionality. + +#### [> Download Dapper.FluentMap.Dommel NuGet package](https://www.nuget.org/packages/Dapper.FluentMap.Dommel) + +#### Usage +##### `DommelEntityMap` +This class derives from `EntityMap` and allows you to map an entity to a database table using the `ToTable()` method: + +```csharp +public class ProductMap : DommelEntityMap +{ + public ProductMap() + { + ToTable("tblProduct"); + + // ... + } +} +``` + +##### `DommelPropertyMap` +This class derives `PropertyMap` and allows you to specify the key property of an entity using the `IsKey` method: + +```csharp +public class ProductMap : DommelEntityMap +{ + public ProductMap() + { + Map(p => p.Id).IsKey(); + } +} +``` + +You can configure Dapper.FluentMap.Dommel in the `FluentMapper.Initialize()` method: + +```csharp +FluentMapper.Intialize(config => + { + config.AddMap(new ProductMap()); + config.ForDommel(); + }); +```