Question

i have a question about how to fill a json object to show a entity with sub entities.Thats because i have x that has got detail entity which is called y.

DbSyncScopeDescription scopeDesc = new DbSyncScopeDescription("filtered_customer");

// Definition for Customer. DbSyncTableDescription customerDescription = SqlSyncDescriptionBuilder.GetDescriptionForTable("Sales.Customer", serverConn);

scopeDesc.Tables.Add(customerDescription);

// Definition for CustomerContact, including the list of columns to include. Collection columnsToInclude = new Collection(); columnsToInclude.Add("CustomerId"); columnsToInclude.Add("PhoneType"); DbSyncTableDescription customerContactDescription = SqlSyncDescriptionBuilder.GetDescriptionForTable("Sales.CustomerContact", columnsToInclude, serverConn);

scopeDesc.Tables.Add(customerContactDescription);

Was it helpful?

Solution

Two additional steps should be done:

  1. Add EnableQuery attribute, or Queryable if not the latest version you are using:

    [EnableQuery] public static y x(Guid Id)

  2. Add $expand to the query URL:

    /odata/2012-01/x(guid'xxxx')?$expand=t

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top