Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 702715
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T03:45:05+00:00 2026-05-14T03:45:05+00:00

I’ve posted some questions on this before, but it’s different. So consider a small

  • 0

I’ve posted some questions on this before, but it’s different.

So consider a small portion of our model:

  • Person
    • Customer
    • Employee
    • Spouse

Person is the base class which has 3 classes that inherit from it.

These 4 are very central in our design and link to many other entities.
I could solve all the problems I’m experiencing with ria-services by removing
the inheritance but that would really increase the complexety of the model.

The first problem I experienced was that I couldn’t query for Customers, Employees or Spouses, but someone gave me a solution, which was to add something like this to the DomainService:

    public IQueryable<Employee> GetEmployees()
    {
        return this.ObjectContext.People.OfType<Employee>();
    }

    public IQueryable<Customer> GetCustomers()
    {
        return this.ObjectContext.People.OfType<Customer>();
    }

    public IQueryable<Spouse> GetSpouses()
    {
        return this.ObjectContext.People.OfType<Spouse>();            
    }

Next I tried something that seemed very normal to me:

var employee = new Employee()
{
    //.... left out to reduce the length of this question 
};

var spouse = new Spouse() 
{
    //.... left out to reduce the length of this questions
};

employee.Spouse = spouse;

context.People.Add(spouse);
context.People.Add(employee);
context.SubmitChanges();

Then I get the following exception:

Cannot retrieve an entity set for the
derived entity type ‘Spouse’. Use
EntityContainer.GetEntitySet(Type) to
get the entity set for the base entity
type ‘Person’.

Even when the spouse is already in the database,
and I retreive it first I get similar exceptions.

Also note that for some reason in some places “Persons” is used instead of “People”…

So how do I solve this problem, what am I doing wrong
and will I keep running into walls when using ria services with inheritance?

I found some references on the web, all saying it works and then some DomainService
code in which they suposedly changed something but no details…

I’m using VS2010 RC1 + Silveright 4

Note: The data sources window that magically works in all the MIX sessions does not work for me… it never displays anything

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T03:45:05+00:00Added an answer on May 14, 2026 at 3:45 am

    This behavior was due to a bug in the RC1. It is discussed in more detail at http://forums.silverlight.net/forums/p/169599/384514.aspx#384514.

    There is no known workaround for RC1, but the hierarchy you show should work fine in RC2. The bug centered around associations using derived types (EntityRef and EntityCollection), so I suspect the Spouse association was what triggered the bug in your scenario.

    Regarding “Persons” v. “People” — the name selection for the entity set comes from EF’s pluralization for the entity names. The name of the query on the client comes from the corresponding query name in the DomainService, meaning you could expose a public IQueryable GetPeople() if you wanted.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some data like this: 1 2 3 4 5 9 2 6
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
this is what i have right now Drawing an RSS feed into the php,
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
We're building an app, our first using Rails 3, and we're having to build
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.