I\'m trying to use Dapper to interface with the ASP.NET SQL Membership Provider tables. I wrapped the SqlMembershipProvider class and added an additional method to get me t
I use this maybe it's help someone
YourList = connection.Query<YourQueryClass>(Query, arg)
.Select(f => new ClassWithConstructor(f.foo,f.bar))
.ToList();
I would use the non-generic Query API here...
return connection.Query(sql, args).Select(row =>
new AnyType((string)row.Foo, (int)row.Bar) {
Other = (float)row.Other }).ToList();
Using this you can use both non-default constructors and property assignments, without any changes, by using "dynamic" as an intermediate step.