07-23-2023, 07:25 AM
Lately I've been hearing a lot about DTOs and how useful they are but I can't find a good example of using it in ASP.NET context.
Let's say I use three tier architecture:
1. Data layer(using Entity Framework)
2. Business Layer(WCF Service)
3. Presentation Layer (MVC 4.0 web application)
Where should I convert from the EF Employee object to an EmployeeDTO POCO?
Lets say I do the conversion in the Data Access layer but what happens in the WCF service? Should it then be converted to another `DataMember` object and when it get's to the UI layer(MVC web app) should it then be converted for the third time to a model? I would appreciate it if someone could please clear this for me
Let's say I use three tier architecture:
1. Data layer(using Entity Framework)
2. Business Layer(WCF Service)
3. Presentation Layer (MVC 4.0 web application)
Where should I convert from the EF Employee object to an EmployeeDTO POCO?
Lets say I do the conversion in the Data Access layer but what happens in the WCF service? Should it then be converted to another `DataMember` object and when it get's to the UI layer(MVC web app) should it then be converted for the third time to a model? I would appreciate it if someone could please clear this for me