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.
public class Invoice
    public int? Id { get; set; }
    public string Code { get; set; }
    public InvoiceKind Kind { get; set; }

    public List<InvoiceItem> Items { get; set; }

    public InvoiceDetail Detail { get; set; }


Dapper.SimpleSave is only available through NuGet:

You can easily install this library by running the following command:

PM> Install-Package Dapper.SimpleSave

More information can be found at:


Once you installed this library then the following extension methods will automatically add to DbConnection:

  • Create
  • CreateAll
  • Update
  • UpdateAll
  • Delete
  • DeleteAll
  • SoftDelete
  • SoftDeleteAll

You can use these extension methods easily in your code.


connection.Update(oldInvoice, newInvoice);



You can find the detailed documentation here:


  • 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.