1)Why Dapper?
EFThe cost of learning is so high that I’ve studied it for a long time, but I still don’t know how to update it to the database after updating the class.
Linq to sqlThis is not bad, but the problem is that if you connect to Mysql, you will die.
Just read this article & lt; & lt; five years later, why should we move from the Entity Framework to the Dapper Tool & gt; & gt; & gt;, and think we can try it.
Basic operation tutorial here, < < Dapper learning notes > > this blogger has only one theme.
2)Version not supported
We now use Framework 4 more, in VS2015 under the direct use of NuGet Dapper installation, even reported that the Framework version is too low, does not support…..
Find and find, find the Internet said to use the Dapper. CS file directly, I believe, using a 6200 lines of Dapper. CS file on OK.
3)Unable to ToList
A simple query is shown in the following table, and the result is wrong at ToList ().
string query = “SELECT * FROM TestType”;
List<TestType> types= conn.Query<TestType>(query).ToList();
No one mentioned this problem on the Internet.
Then it suddenly came to mind that what was not quoted and added the following code to solve it.
using System.Linq;