0
I am using the Entity framework and developing a system through ASP.NET MVC5 but I was in doubt about CRUD.
The methods of interaction with the database (Create,Update,Select,Delete) should be inserted in which part of the project? I thought about describing each of these functions within the Model classes, but it doesn’t seem right.
Another question... the right one is to create a generic CRUD interface for all models?
Look, Cleiton, I’m gonna put this in for comment because I don’t know if that’s a good answer. But, this interaction with the bank can be done in a class in a directory within the same project. This would be the famous DAO - Data Access Object. That would be the generic repository of your project. And regarding the second doubt, I think yes, can create a generic for all models. But I’m not sure about that.
– Érik Thiago
@Érikthiago Cara, please, forgets generic repository. I’ve written several responses telling you not to use this approach.
– Leonel Sanches da Silva