1
我即将开始使用.NET 4,C#和Entity Framework v4的小型项目。实体框架通用CRUD
我有50个表加上。如果我为每个实体编写一个单独的CUD(每个表)将会有很多工作,并且我正在练习DRY。所以,我正在考虑实体框架的通用CUD。但是对于通用的CUD有优缺点 。
在搜索实体框架的通用CUD后,我在https://github.com/rcravens/GenericRepository 找到了一个,它有一些优点和缺点。
Cons:
Hides useful features of the ORM
Adds complexity to the design
Pros:
Abstracts away the ORM/persistence implementation
Allows the persistence layer to be faked for testing
那么,如果你使用了一个实体框架的通用CUD,你有什么大问题?另外,在GenericRepository旁边是否有实体框架的通用CUD?