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 3982468
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T05:31:53+00:00 2026-05-20T05:31:53+00:00

I’m developing a Silverlight Business Application, using a RIA service, which is returning POCO

  • 0

I’m developing a Silverlight Business Application, using a RIA service, which is returning POCO entities (TaskTime and User). The TaskTime entity has a User entity associated with it.

I have created a domain service which has a query function (GetTimesheet) which returns an IQueryable collection of TaskTime entities, which works fine if I don’t try and get the associated User entities as well, but as soon as I include the [Include] and [Association] attributes above the ‘User’ property in the ‘TaskTime’ entity I start getting deserialization errors saying:

The formatter threw an exception while trying to deserialize the message […] The InnerException message was ‘Error in line 1 position 266. Element ‘http://schemas.microsoft.com/2003/10/Serilaization/Arrays:anyType’ contaings data of the ‘http://schemas.datacontract.org/2004/07/Timesheets.Entities:User’ data contract. The deserializer has no knowledge of any type that maps to this contract. Add the corresponding the ‘User’ to the list of known types…’

It suggests that I use the ‘KnownTypes’ attribute, but I can’t seem to find a place to put that which resolves this error.

Does anyone have any clue how to resolve this? I can see in the ‘Generated_Code’ in my Silverlight application that both types seem to be created properly, with DataContract attributes added etc..

Simplified versions of my POCO entities are:

public partial class TaskTime
{
    [Key()]
    public virtual int ID   { get; set; }

    public virtual int User_ID  { get; set; }

    [Include]
    [Association("TaskTime_User", "User_ID", "ID", IsForeignKey=true)]
    public virtual User User
    {
        get { return _user; }
        set
        {
            if (!ReferenceEquals(_user, value))
            {
                var previousValue = _user;
                _user = value;
                FixupUser(previousValue);
            }
        }
    }
}

public partial class User
{
    [Key()]
    public virtual int ID   { get; set; }

    public virtual string Name  { get; set; }
}
  • 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-20T05:31:53+00:00Added an answer on May 20, 2026 at 5:31 am

    This is probably because you don’t have methods in your DomainService for CRUD operations on the User class (I am guessing since you haven’t supplied the code for your service).

    In RIA, if you want to expose a type to the client, you have to do one of two things:

    (A) Expose CRUD operations for that type on the service

    -or-

    (B) Use the [Composition] attribute on the parent class (in this case, your TaskTime class).

    The [Composition] attribute makes it so that RIA will only grant CRUD operations to the User class via it’s parent – so the User class won’t have it’s own CRUD operations on the Service and can thus only be updated through its parent class.

    Which road you choose depends on how you want your app to function. In some cases, [Composition] is appropriate.

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

Sidebar

Related Questions

No related questions found

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.