I am learning EF Code First, and I am a little struggling with which templates to use in my application. I read a lot of conflicting suggestions and recommendations that say you should use the repository template, while others say that this is superfluous, and I tend to agree.
Here is my dividend:
Suppose I create a REST web service that allows me to manage clients. This service will allow me to add clients, delete settings and edit clients and find clients.
Should I:
A.) My question comes down to where my business logic should go. Should I have a CustomerManager class that provides add, edit, delete, and search methods that accept a Customer object? Should my validation logic use these methods?
B.) Do I have to use the Active Record style for development when my Customer object would have Save (), Delete (), and Find () methods on it, with all checks performed inside the Customer class?
C.) Do I have to do some kind of hybrid where the simple verification logic is the essence itself. This could be done using code that ascribes first. I could also have a simple save method for an object. Then I could perform complex business validation logic, delete (), find () and save the multi-node objects in the CustomerManager class?
C. Manager/Service, . , , , .
, , , .