EF中的RIA服务和继承 [英] RIA Services and Inheritance in EF
本文介绍了EF中的RIA服务和继承的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有下一个EF图:图片
和代码服务:
[EnableClientAccess()]
public class DomainService1 : LinqToEntitiesDomainService<db1Entities1>
{
public IQueryable<Entity1> GetMaster1()
{
return this.Context.Master.OfType<Entity1>();
}
public IQueryable<Entity2> GetMaster2()
{
return this.Context.Master.OfType<Entity2>();
}
}
在编译过程中,我遇到下一个错误:
In the compile process I have the next errors:
Error 1 The type 'TestInheritance.Web.Entity1' already contains a definition for '_typeId' D:\FAUst\SourceExamples\TestInheritance\TestInheritance\Generated_Code\TestInheritance.Web.g.cs 183
Error 2 The type 'TestInheritance.Web.Entity1' already contains a definition for 'TypeId' D:\FAUst\SourceExamples\TestInheritance\TestInheritance\Generated_Code\TestInheritance.Web.g.cs 273
Error 3 The type 'TestInheritance.Web.Entity2' already contains a definition for '_typeId' D:\FAUst\SourceExamples\TestInheritance\TestInheritance\Generated_Code\TestInheritance.Web.g.cs 310
Error 4 The type 'TestInheritance.Web.Entity2' already contains a definition for 'TypeId' D:\FAUst\SourceExamples\TestInheritance\TestInheritance\Generated_Code\TestInheritance.Web.g.cs 400
除了此错误外,我该怎么办?
What I can doing that except this errors?
推荐答案
您不能在RIA Services中使用类似的继承.您加载到RIA Services的所有需要继承知识的东西都将失败.
You can't use inheritance like that with RIA Services. Anything you load to RIA Services that requires knowledge of the inheritance is going to fail.
这篇关于EF中的RIA服务和继承的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文