Reputation: 397
I'm currently working on a team project where we have to work with the Entity Framework.
Our WinForms application is using the MVC
design pattern, and by that fact, we are not quite sure how to work with the data.
context
and make changes to this?DataManager
class that is part of
the Controller
, and then create the appropriate (needed) methods
within this class? For example, if we need a method that returns all
persons with IDs between x and y, then we would make this method in
the DataManager that takes x and y as input.Thank you for your suggestions.
Upvotes: 0
Views: 203
Reputation: 3347
I personally like repository pattern. There are a lot more less formal samples with code on the web. One of "bonus" advantages is that you can make a fake implementation that does not go to DB and use it for unit testing.
But there is no one best approach to this problem.
Upvotes: 1