ASP.NET and Entity Framework in Layered Architecture - using Entity Framework for ORM only ASP.NET and Entity Framework in Layered Architecture - using Entity Framework for ORM only asp.net asp.net

ASP.NET and Entity Framework in Layered Architecture - using Entity Framework for ORM only


  1. If you are practical: Yes! It will avoid you double mapping work and the potential errors generated by the double mapping. (By double mapping I mean DB -> ORM and ORM -> Business logic).
  2. Use TransactionScope. It's the best way to do transaction without worrying about nested transactions.


I suspect that this may be the answer to your problem:

http://code.msdn.microsoft.com/EFPocoAdapter/Release/ProjectReleases.aspx?ReleaseId=1580

The tool generates classes that have no entity framework dependency that you can pass across tiers.


Another way to do this is to use mapper classes, use what EF purely as data access and use the classes EF generated only within the DAL, then map these DAL objects to your BLL's objects through mappers. It works fine for us.