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

  • Home
  • SEARCH
  • 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 1097489
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T00:26:27+00:00 2026-05-17T00:26:27+00:00

I got this DomainService method I’m calling from my SL ViewModel using the Invoke

  • 0

I got this DomainService method I’m calling from my SL ViewModel using the Invoke attribute:

[Invoke]
public ServiceModel.Recipy GetRecipyById(int recipyId)
{
    return new Recipy
                {
                    RecipyId = 1,
                    Name = "test",
                    Description = "desc",
                    Author = new Author
                                {
                                    AuthorId = 1,
                                    Name = "Johan"
                                }
                };
}

The code in my ViewModel looks like this:

public RecipyViewModel()
{
    context.GetRecipyById(1, RecipyLoadedCallback, null);
}

private void RecipyLoadedCallback(InvokeOperation<Recipy> obj)
{
    _name = obj.Value.Name;
    _description = obj.Value.Description;
    _authorName = obj.Value.Author.Name;
}

The Recipy and Author POCO/ServiceModel classes:

public class Recipy
{
    [Key]
    public int RecipyId { get; set; }
    public string Name { get; set; }
    public string Description { get; set; }

    [Association("Author", "RecipyId", "AuthorId")]
    [Include]
    public Author Author { get; set; }
}

public class Author
{
    [Key]
    public int AuthorId { get; set; }
    public string Name { get; set; }
}

Now, the code works fine, except that the associated Author is not transfered over to the client/viewmodel, the Author property of Recipy is null. I thought that using the [Associate] and [Include] attributes would do the trick?

Thanks for any help, I’m trying hard to grok the DomainService/RIA stuff and I’m close to giving up and go “normal” WCF/REST instead 🙂

  • 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-17T00:26:28+00:00Added an answer on May 17, 2026 at 12:26 am

    As I understand it, [Invoke] doesn’t support complex hierarchies at the moment, so I solved it by making sure I had the correct attributes for [Include] and [Association] on the collection, and went back to using a normal RIA query method instead.

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

Sidebar

Related Questions

I got this compile time string comparison from another thread using constexpr and C++11
My WCF-RIA DomainService has an insert method that looks like this: public void InsertWidget(WidgetDef
Got this code in C#: using System; public class Listener{ public static void Main(){
Got this code for a viewscroller from the apple developers site. @synthesize scrollView1, scrollView2;
I´ve got this on the parent object @OneToMany(mappedBy=idUser, cascade = CascadeType.MERGE) public List<Directions> directions;
I got this code from our frontend guy for headings: <h2 class=headline><span>Foobar</span></h2> The span
Got this regex string from JavaScript: the good parts (pp. 66). Can't get it
got this code from a website that helped me in creating buttons and stuff.
I got this: SELECT deals.* FROM deals JOIN deals_bookings ON (deals_bookings.deal_id = deals.ID) WHERE
I got this example from one StackOverflow question that was asked but I couldn't

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.