Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is why I love Dapper micro-ORM in the .NET world. It gives you the best of both worlds.

You are still close to SQL, but you get objects back. Started by Sam Saffron (StackOverflow) and used by StackOverflow themselves, it is fast, well written, concise and easy to use.

Basic usage:

   IEnumerable<Account> resultList = conn.Query<Account>(@"
                    SELECT * 
                    FROM Account
                    WHERE shopId = @ShopId", 
   new {  ShopId = shopId });
Performance of SELECT mapping over 500 iterations - POCO serialization:

   Hand coded (using a SqlDataReader)	47ms
   Dapper ExecuteMapperQuery<Post>	49ms
   ServiceStack.OrmLite (QueryById)	50ms
   PetaPoco				52ms
   BLToolkit				80ms
   SubSonic CodingHorror		107ms
   NHibernate SQL			104ms
   Linq 2 SQL ExecuteQuery		181ms
   Entity framework ExecuteStoreQuery	631ms
- https://code.google.com/p/dapper-dot-net/

- http://www.tritac.com/bp-24-dapper-net-by-example

- http://en.wikipedia.org/wiki/Dapper_ORM

- http://code.google.com/p/dapper-dot-net/source/browse/Tests/...



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: