Note that there are some explanatory texts on larger screens.

plurals
  1. POAutomapper for use with Entity Framework using repository pattern?
    primarykey
    data
    text
    <p>Been busy creating a new app, basically i have my dataccess, service layer and presentation layer... All works great but i am using the entity classes that are returned by EF. Problem here is i pass these onto the presentation layer so i need to add the entity framework reference /dataccess to the presentation layer - NOT GOOD:</p> <p>So my idea was the following and was looking for some help and confirmation that i am going down the right lines...</p> <ol> <li><p>Create a set of classes in the service layer like customer, order etc because the presentation layer has a reference to the service layer..</p></li> <li><p>When a customer entity is returned in the dataccess i would return the entity class i.e. Customer to the service and i would do the mapping here - Not too sure if i like this? </p></li> <li><p>where would be the best places for the these "standard classes" that i use for mapping, if i put them in the service layer and do the mapping the dataaccess then this would create a circular reference as Dataccess > service and service > dataaccess.. - it should be only one way i.e. service > dataaccess</p></li> </ol> <p>I was thinking of using Automapper (<a href="http://www.codeplex.com/AutoMapper" rel="noreferrer">http://www.codeplex.com/AutoMapper</a>) to take care of this, am i on the right lines??? Any ideas or examples really appreciated..</p> <p>As i say the only thing is that when i return from dataaccess to service layer (using Iqueryable) i need to map these away from the entity classes and use standard collection classes..</p> <p>I think this is where i get confused, i do feel it isn't good using the entity classes because that means i need a reference to the entity framework / dataaccess in my presentation layer to be able to access the entity classes..</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload