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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:50:40+00:00 2026-05-26T01:50:40+00:00

I’ve created a complex object which itself include a list of another object. Example:

  • 0

I’ve created a complex object which itself include a list of another object.

Example:

public class MyClass1
{
    private List<MyClass2> myClass2List

    [Key]
    public long Id { get; set; }

    public string Name { get; set; }

    [Include]
    [Association("FK_MyClass1_MyClass2", "Id", "MyClass1Id")]
    public List<MyClass2> MyClass2List
    {
        get
        {
            if (this.myClass2List == null)
            {
                this.myClass2List = new List<MyClass2>();
            }

            return this.myClass2List;
        }
        set { this.myClass2List = value; }
    }
}

public class MyClass2
{
    [Key]
    public long Id { get; set; }

    public string Value { get; set; }

    public long MyClass1Id { get; set; }
}

Now I want to send an instance of MyClass1 (which its MyClass2List is full) to the RIA services.

My first try was creating a get method with MyClass1 return type (to expose MyClass1) and also creating an Insert method for MyClass1 and MyClass2. It works but the MyClass2 Insert method is useless! I insert all the information in MyClass1 method. Also the get method is useless!

This is the domain service that works:

[EnableClientAccess]
public class MyDomainService : DomainService
{
    public MyClass1 GetMyClass1()
    {
        return null;
    }

    [Insert]
    public void Insert(MyClass1 myClass1)
    {
        ... (Main code)
    }

    [Insert]
    public void Insert(MyClass2 myClass2)
    {
        // I leave this method empty because I do the job in MyClass1 Insert method.
        // If I don't add this method the Add operation on MyClass2List will not work!
    }
}

As you see it doesn’t have a clear implementation. Although I could use the traditional WCF Silverlight-Enabled services and simply use a single method to insert the MyClass1 instance.

Note that I tried the [Invoke] method (A simple invoke method which gives the MyClass1 as an input parameter) but then “MyClass1.MyClass2List” is empty!!!

How can I send a complex object to RIA services without having such useless methods and dirty implementation? I need to do all my works just in a single method. I don’t need tracking and etc here. Is it better to use the traditional WCF Services besides the RIA or is there another way about RIA?

Thanks in advance

  • 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-26T01:50:41+00:00Added an answer on May 26, 2026 at 1:50 am
    • You need to add [Composition] attribute to your one-to-many relationships as well. more info:[ +, +, + ]
    • Also Try to switch to “RIA Services EF Code First Support“
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i got an object with contents of html markup in it, for example: string
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from
public static bool CheckLogin(string Username, string Password, bool AutoLogin) { bool LoginSuccessful; // Trim
Basically, what I'm trying to create is a page of div tags, each has
That's pretty much it. I'm using Nokogiri to scrape a web page what has
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

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.