I'm attempting to implement a Generic Repository pattern for a MVC5 EF6 solution. My database already exists so I'm using a DB first approach. I'd like to get around having to create a Repository class (ie: CustomerRepository, OrderRepository, etc...) for every entity in my database as it has many tables. Also, my client needs to consume complex types (ie: CustomerOrders) that don't exist as a table in the database but could probably be created through Query Objects.
Can anyone give me advice/share code on best practices for my implementation? If the Repository pattern is supposed to give you a clear level of abstration between your Buisness layer and Data access code how will I reference the data entities (.edmx tables) returned from my Repository method calls in the business layer. Kindest regards
Aucun commentaire:
Enregistrer un commentaire