Answer the question
In order to leave comments, you need to log in
What is the feature of Dapper?
I read this guide on Dapper and I just can’t understand how it differs from the usual ADO.NET? The same classes are also used there, regular SQL queries, no ORM smells ... ORM is when pure SQL does not have to be written at all. Like in Django or Yii.
P.S. Do not agitate me in favor of the Entity Framework. I know about it and would be happy to do it myself, but the customer's requirement is tough Dapper.
Answer the question
In order to leave comments, you need to log in
First comment on that article:
The difference, perhaps, is that you have automatic mapping (judging by the article).
In ADO.NET, you need to manually fetch values from the reader yourself (like reader.GetInt32(0)). Which is not very nice, especially when working with a large number of complex tables
Toli is the case when you describe a class, make a request and ask to return an instance
User user = null;
using (IDbConnection db = new SqlConnection(connectionString))
{
user = db.Query<User>("SELECT * FROM Users WHERE Id = @id", new { id }).FirstOrDefault();
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question