且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

通用存储库模式和复杂的LINQ查询

更新时间:2022-05-05 01:45:24

在通用存储库模式之外编写并不是一个很好的做法,你将破坏拥有存储库模式的整个目的



您可以根据您的特殊要求自定义存储库模式,并且仍然将其存储在存储库模式下,并且不会重新调整以直接访问DBcontext
It is not a good practice to write outside the generic repository pattern and you will be defeating the whole purpose of having the repository pattern

You could customize the repository pattern for your special requirement and still have it under repository pattern and it is not recomanded to access the DBcontext directly