I have been using NHibernate for large corporate projects for a while now, but wanted to leverage a lighter ORM for some personal projects. I did not want the overhead of configuring NHibernate and wanted something "lighter".
I have heard many developers discuss Dapper. I was interested in looking into it, but I do not like InLine SQL. I would rather use LINQ. On GitHub there is a package called SQLinq for Dapper!
The screen shots below (and ZIP file Download) shows using Dapper with Inline SQL and LINQ over a SQL Server Northwind Database. This project is a console app built in Visual Studio 2015.
If you decided to use this sample project you will need to update your connection string. (To keep this simple I am not documenting the connection method here)
![](../../../../../image0642.html?picture=/2016/ConnectionString.png)
1. Create a Customer Entity
![](../../../../../imagee814.html?picture=/2016/Dapper-Entity.png)
2. Dapper Inline SQL Example
![](../../../../../imagec6cf.html?picture=/2016/01-Dapper-Inline-SQL.png)
3. Dapper LINQ Sample
![](../../../../../imaged178.html?picture=/2016/02-Dapper-LINQ.png)
4. Console App Results
![](../../../../../image286e.html?picture=/2016/Dapper%20Results.png)
Download DapperSample.zip C# Console App Source