在Simple.Odata.Client中扩展嵌套集合属性时出现问题。
任何帮助将不胜感激。
请考虑以下“结构”类。
Employee
{
public string EmployeeNumber;
public List<Contact> EmployeeContact;
}
Contact
{
public string address_line1;
public State StateId;
}
State
{
public string Name;
public string Code;
}
我想从“联系人”中扩展“州”。我要查询员工,因为我想通过员工编号来获取员工联系人。
await this.ServiceCall.ExecuteServiceCall(() => client.For<Employee>().
Filter(c => c.EmployeeNumber== EmployeeNumber).Expand(e => e.EmployeeContact.Select(s => s.StateId)).FindEntryAsync();
我遇到了错误。
“属性' DisplayName '在类型'Microsoft.Dynamics.CRM.State'中不存在。请确保仅使用由类型定义的属性名称或将类型标记为打开类型。” ]
我知道CRM中存在这种关联。为了简单起见,我能够看到此关联及其查找表名称。