Massive: 400 Lines of Data Access Happiness
Posted by Ramani Sandeep on February 23, 2011
Rob Conery blogs about an interesting lightweight data access he’s writing for WebMatrix that’s focused on simplicity and driving .NET 4 dynamic support for all it’s worth.
Massive is a “wrapper” for your DB tables and uses System.Dynamic extensively. If you try to use this with C# 3.5 or below, it will explode and you will be sad. Me too honestly – I like how this doesn’t require any DLLs other than what’s in the GAC. Yippee.
- Get a Database. Northwind will work nicely. Add a connection to your database in your web.config (or app.config). Don’t forget the providerName! If you don’t know what that is – just add providerName = ‘System.Data.SqlClient’ right after the whole connectionString stuff.
- Create a class that wraps a table. You can call it whatever you like, but if you want to be cool just name it the same as your table.
- Query away and have fun
Hope this will helps !!!
Jay Ganesh