In my ASP.NET application I want to implement by data acess layer using the Entity framweok so I can use it as an ORM tool. But I dont want the rest of the application to care that I'm using this or be polluted by anything entity frameowrk specific.
I cant seem to find anyone who is using the entity framework exclusively in their Data access layer so I'm keen to see any online examples of this/ experience people have.
Entity Framework is a data access layer. Specifically it's an Object Relational Mapper.
Select your project in the VS Solution Explorer window and press CTRL+SHIFT+A to add a new item. Search for the ADO.NET Entity Data Model item, then click “Add” to proceed. After the ADO.NET Entity Data Model component is added, it will automatically pop up its Data Model Wizard.
The recommended approach, however, is to separate the data access logic from the presentation layer. This separate layer is referred to as the Data Access Layer, DAL for short, and is typically implemented as a separate Class Library project.
http://ayende.com/Blog/archive/2007/06/08/Rhino-Commons-RepositoryltTgt-and-Unit-Of-Work.aspx
Look at the above example, you can implement entity framework in the same fashion using repository pattern
You could abstract the entity framework using something like the repository pattern like ScottGu does with Linq in the NerdDinner series.
http://nerddinnerbook.s3.amazonaws.com/Part3.htm
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With