Reputation: 17298
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);
Upvotes: 0
Views: 338
Reputation: 3345
Two additional steps should be done:
Add EnableQuery attribute, or Queryable if not the latest version you are using:
[EnableQuery] public static y x(Guid Id)
Add $expand to the query URL:
/odata/2012-01/x(guid'xxxx')?$expand=t
Upvotes: 1