Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Oct 20, 2011 05:31 PM by ThatsIT
Oct 20, 2011 11:35 AM|LINK
I am writing an MVC application, and thinking of to use Entity Framework.
I have read lots of blogs about EF 4, but one thing that bothers me is the seperation.
I think, in EF, the entities (types) and its mapping with data source (i.e. Stored Proc/ table) should be within the same class library project. If that's the case, then my MVC application will have to use direct reference to that data library. Which I feel
is a bad design.
The ideal design what I feel is that MVC will refer to a class that will have only types (entities), and NOT their mapping with the database interaction code. That is why, I need seperation of these into 2 different layers.
My WCF service will reference both of them, but MVC application will reference only the class library having Entities defined.
Is this possible anyway?
Oct 20, 2011 05:31 PM|LINK
Not sure if I folow you, but i tell you how i set things ourt if it helps
ClassLibrary (Business objects)
I have business objects for each entity that handles all comunications with the EF layer using linq
The view models handle complex models, but if I want just a single entity in my model, i will go straight to the business object layer