Third Party Library - Dapper.SimpleSave
Dapper.SimpleSave is a small library package which adds basic CRUD operations to Dapper. Dapper easily retrieve data from the database when a single object is involved, but when you are dealing with complex hierarchies, then dapper is not very helpfull.
This is where Dapper.SimpleSave comes in and save complex objects to the database in a very simple way.
Dapper.SimpleSave need to decorate your domain classes with attribute, for example;
- Names of the tables and columns in a database.
- Which property represent primary key columns.
- The cardinality of relationships between tables etc.
Dapper.SimpleSave is only available through NuGet: https://www.nuget.org/packages/Dapper.SimpleSave/
You can easily install this library by running the following command:
PM> Install-Package Dapper.SimpleSave
More information can be found at: https://github.com/Paymentsense/Dapper.SimpleSave/
Once you installed this library then the following extension methods will automatically add to DbConnection:
You can use these extension methods easily in your code.
You can find the detailed documentation here: https://github.com/Paymentsense/Dapper.SimpleSave/wiki/
- Convention based mapping are not supported, and you will need to decorate your domain classes with attributes.
- Currently, only integer, long, and GUID primary keys are supported.
- In all your domain classes, a primary key property should be marked with a [PrimaryKey] attribute.
Unfortunately, this library is not supported.