E.F 4.1 CodeFirst,Generic Repository Pattern,UoW,MVP
I developed a windows form project with using E.F 4.1 CodeFirst model, Generic RepositoryPattern, Unit Of Work and MVP.
I made 4 layers which are like below.
DataAccessLayer (Entities like tblCustomers, tblUsers, Repositories like CustomerRepository,UserRepository)
UI -->Windows Forms.
My Problem is carrying exceptions beetween the layers and carriying the data between the layers. I made a DTO datatransfer objects which names like CustomerDto, UserDto.
When I query generic repository forexample CustomerRepository<tblCustomers> it returns tblCustomer type data , but i want to fill CustomerDto class , so i have to write query business layer, But i have to this job in Data Access Layer , I dont want to carry tblCustomer entities between the layers.
Is it correct what i have done, if wrong how can i do..
Volkan Genç, May 11, 2012
I've done similar things, and my suggestions are:
You can find out about AutoMapper at AutoMapper.org.
I hope this helps.
King Wilder, Jun 01, 2012