Skip to main content


Showing posts from August, 2010

Entity Framework : Hello World

BackgroundRecently I have been working on lot of code related to database persistence. Writing a data access layer is always a tedious job due to the fact that the relational model of the RDBMS and the domain model of the application might not always be having one to one mapping. We have been using NHibernate as Object Relational Mapping (ORM) tool for our projects for quite sometime. I faced few minor issues around integrating NHibernate with our application. I think NHibernate suffers from the same problem that most of the open source projects face with regards to proper documentation and guideline.
As a result I decided to try something else and Entity Framework seemed to be a good option. The version 4 is out as CTP and there is lot being written about the code-first approach. I had used EF earlier when I was trying the ASP.NET MVC Music Store sample application. On that occasion I blindly followed the steps mentioned in the document and everything was working like magic.
There is…