Im trying to use EF4.1 in a setup where I would have a DAL (data access layer), BLL (business logic layer) and then a presentation layer (usually ASP.NET web app or console app maybe).
Currently I do all my projects using LINQ to SQL and have a set up that uses multi layers as descibed above.
When looking at EF though all the examples just seem to use 1 layer or maybe 2 layers its hard to find a full example that uses a DAL and BLL.
The closest I've got to what I want at the moment is to use the POCO code generator to create POCO classes and then re-locate these classes into my BLL project - and the .edmx and the object context remain in the DAL.
The problem with this though is the DAL needs a reference to the BLL so that it knows about the POCO classes - ideally the reference would be the other way round. If the DAL has a refernce to the BLL I cant also have a reference from the BLL to the DAL - because you can't have circular references, so I cant do anything with the object context like call the save changes method from the bll.
Anyway I've got in a bit of a mess with it all.
I'm considering doing things in a different way (similar to what I do currently with LINQ to SQL) where the EF entity objects stay in the DAL and I write my own BLL classes that just 'piggy back' onto their DAL object counter parts. That way the DAL can have a reference to the BLL and the BLL.
Sorry its a long question but appreciate people's thoughts, I really have spent hours and hours reading about EF but struggle to see how it can work in a multi layered approach.