New answers tagged dependency-injection
Interfaces are used to define a contract: implementing an interface is a way for a class to indicate that a certain set of methods can be called on it, that these methods require well-defined arguments and that the result of the method will be of a certain type. You need to think about the significance of the methods on the interface. If the methods on the ...
Have both an interface and an abstract class which implements it so that only those implementations which need to derive from something else have to handle the dependency themselves, and they can look at the abstract class for guidance. Document it properly as well, of course.
In my experience, trying to make a framework like EF work in a repository pattern is not the best if you really want to bundle transaction and separate functionality out into Repo's like that. I would have the MVC controller instantiate an EF data context, and be responsible for calling "SaveChanges()" after its done any active-record data manipulations. For ...
Top 50 recent answers are included