RIA Services and Inheritance in EF

I have the next EF diagram: Image

and the code service:

[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?

Answers


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.


Now you can: http://code.msdn.microsoft.com/Project/Download/FileDownload.aspx?ProjectName=RiaServices&DownloadId=8351


Need Your Help

Programmatically Scroll Silverlight ListBox

silverlight listbox scroll

I tried using the following method, but it doesn't seem to work on databound listbox.

Android searchview hide keyboard but no losing focus

android android-layout android-fragments

I've a PDA with Android and barcode scanner integrated. I would to hide always keyboard to use barcode scanner. I've a searchview with an editetext field to search into my products through my app. ...