阅读背景:

为MVC最佳实践定义存储库

来源:互联网 

I want to have a single repository for all my classes/entities. All the controllers from an MVC app should be able to use this repository without creating new instances. The repository must have an extracted interface, for testing or other purposes - therefore the repository class will not be static, since static classes cannot implement interfaces. Yet, it will have a static property, which will be available without instantiating the Repository class. The constructor might be redundant or replaced by a method. Please let me know if it's a good implementation or a bad practice. Or let me know if could be improved somehow:I want to have a single repository for all my c




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: