ASP.Net Layered app - Share Entity Data Model amongst layers

Posted by Chris Klepeis on Stack Overflow See other posts from Stack Overflow or by Chris Klepeis
Published on 2010-05-17T15:26:25Z Indexed on 2010/05/17 15:30 UTC
Read the original article Hit count: 278

How can I share the auto-generated entity data model (generated object classes) amongst all layers of my C# web app whilst only granting query access in the data layer? This uses the typical 3 layer approach: data, business, presentation.

My data layer returns an IEnumerable<T> to my business layer, but I cannot return type T to the presentation layer because I do not want the presentation layer to know of the existence of the data layer - which is where the entity framework auto-generated my classes.

It was recommended to have a seperate layer with just the data model, but I'm unsure how to seperate the data model from the query functionality the entity framework provides.

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about entity-framework