简体   繁体   English

基于抽象实体(EF 4.1)的包含属性的问题

[英]Problem with include property based on Abstract Entity (EF 4.1)

the LoadProperty is good alternative for Include method... Problem with Eager Loading Nested Navigation Based on Abstract Entity (EF CTP5) LoadProperty是Include方法的不错选择... 基于抽象实体(EF CTP5)的Eager加载嵌套导航问题

But I can't do it in my Repository because i haven't context, I just have IDbSet. 但我无法在我的存储库中执行此操作,因为我没有上下文,我只有IDbSet。 Think you it's bad idea ? 认为这是个坏主意? Should I have the DbContext instead of IDbSet ? 我应该使用DbContext而不是IDbSet吗? Or an other alternative is possible ? 或者另一种选择是可能的吗? (My problem is similar to the referenced link) Thanks (我的问题类似于引用的链接)谢谢

Use DbContext in repository. 在存储库中使用DbContext You can need it for much more operations and because repository is already dependent on EF there is no reason to hide context from it. 您可以将它用于更多操作,并且因为存储库已经依赖于EF,所以没有理由隐藏它的上下文。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM