Dapper.Contrib is a NuGet library that extends the IDbConnection
interface. It adds some generic utility methods to Dapper, and particularly CRUD operations become much simpler with Dapper.Contrib.
The following is the list of extension methods that are provided in Dapper.Contrib.
T Get<T>(id);
IEnumerable<T> GetAll<T>();
int Insert<T>(T obj);
int Insert<T>(Enumerable<T> list);
bool Update<T>(T obj);
bool Update<T>(Enumerable<T> list);
bool Delete<T>(T obj);
bool Delete<T>(Enumerable<T> list);
bool DeleteAll<T>();
You can easily install it from the Package Manager Console window by running the following command.
PM> Install-Package Dapper.Contrib