문제

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);

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top