Using Silverlight 3 and RIA Services I have the following class defined in my Web project:
public class RegionCurrentStates
{
public RegionCurrentStates()
{
Name = String.Empty;
States= new List<State>();
}
[Key]
public string Name { get; set; }
public List<State> States{ get; set; }
}
On the client, however, the class only shows up with the Name property. States doesn't show up anywhere. I'm assuming that I must be missing some sort of metadata but I don't know what it is.
Edit: I should clarify that State is a LinqToSql generated class.
Best Answer
Please see: RIA Services Overview - 4.8.1 Returning Related Entities.
In service function where you return RegionCurrentStates list add DataLoadOptions and in metadata description add Include attribute to States propriety.
Add DataLoadOption in your query function defined in domain class.
In metadata:
Good luck.