Jordan
Jordan

Reputation: 9911

RIA Services: Entities with child entities

Is it possible to have child objects on RIA Services entities that are also entities themselves?

public class Project
{
    [Key]
    public int ID { get; set; }

    [Editable(false)]
    public String Name { get; set; }

    public Machine Machine { get; set; }
}

public class Machine
{
    [Key]
    public int ID { get; set; }

    [Editable(false)]
    public String Name { get; set; }
}

Upvotes: 0

Views: 421

Answers (2)

Peter
Peter

Reputation: 3956

You can specify the [Include] attribute on the Machineproperty in the metadata class and add a call to Include("Machine") on the object context query.

See: http://vincenthomedev.wordpress.com/2010/01/08/using-wcf-ria-services-to-include-multi-table-master-detail-data/

Upvotes: 2

BrandonZeider
BrandonZeider

Reputation: 8152

I don't think so, at least not in the traditional sense.

Upvotes: 0

Related Questions