实体框架代码优先 - 不支持索引属性
在带有实体框架代码的 poco 上使用索引器首先会抛出错误“不支持索引属性”。保存上下文时。
有没有办法首先在 pocos 上使用实体框架代码的索引器?我尝试将 [NotMapped] 属性应用于索引器声明,但没有帮助。
Using indexers on a poco with entity framework code first throws the error "Indexed properties are not supported." when saving the context.
Is there a way to use indexers on pocos with entity framework code first? I tried applying the [NotMapped] attribute to the indexer declaration but it did not help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试使用 WriteEDMX 来查看 EDMX 是否引用了这些属性 - 我怀疑不是,并且限制在于核心 EF 运行时而不是 Code First(Code First 在您创建第一个 DbContext 时已完成)。
Try using WriteEDMX to see whether the EDMX is referencing those properties - I suspect it isn't and that the limitation is with the core EF runtime not Code First (Code First is finished by the time you create your first DbContext).