EF 代码优先 CTP 5 中 MapHierarchy() 的替代方案
如何在新CTP中设置以下内容?
modelBuilder.Entity<RequestBase>()
.MapHierarchy()
.Case<RequestBase>(b => new { b.Id, b.Comment, Discriminator = 0 })
.Case<Request1>(s => new { request1_Id = Column.Id, Discriminator = 1 })
.Case<Request2>(m => new { request2_Id = Mission.Id, m.Comment, m.Date, Discriminator = 2 })
.ToTable("dbo.Requests");
How can I set the following in the new CTP?
modelBuilder.Entity<RequestBase>()
.MapHierarchy()
.Case<RequestBase>(b => new { b.Id, b.Comment, Discriminator = 0 })
.Case<Request1>(s => new { request1_Id = Column.Id, Discriminator = 1 })
.Case<Request2>(m => new { request2_Id = Mission.Id, m.Comment, m.Date, Discriminator = 2 })
.ToTable("dbo.Requests");
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
像这样的事情会起作用:
Something like this will work: