Is there a Micro-ORM by Microsoft?

.net dapper micro-orm orm

Question

The micro-ORM Dapper can populate an object from a database very easily without the need for other entity or class definitions. Below is an example of Dapper code.

Is there an equivalent Microsoft package with the same functionality?

What is Microsoft's package that is closest to Dapper?

var stuff = db.Query<stuffclass>("select a,b,c from Foo where a = {0}", x)

Expert Answer

Enterprise Library 5.0 (and possibly earlier versions, I haven't checked) contains methods like ExecuteSqlStringAccessor<TResult>, which I believe it does using the MapBuilder<TResult> API. I haven't done any work with this to comment on it's abilities / performance.

Another interesting option is to use something like a LINQ-to-SQL DataContext without telling it about a model, and just use the ExecuteQuery<TResult> method; since the type isn't known to the data-context, it should skip all the identity-manager/change-manager bits. However! It should be noted that one of the reasons we wrote dapper in the first place was because we were noticing performance problems (lost time, nothing to do with the query itself - looked like perhaps the metaprogramming cache layer).


Popular Answer

I would check out SQL Data (http://sqldata.codeplex.com). It is quick like Dapper and very developer friendly.

(Disclosure - I am the the author of SQL Data)



Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why