0
當嘗試選擇屬性作爲類時,出現問題。當我得到整個屬性(沒有$ select)時,它可以正常工作。
但是,如果我使用類屬性$ select,沒有錯誤,但該屬性不會返回。
GetByIds?$選擇=項目Id,匹克
摘不回來。只有ItemId。
public class ItemNotification : Entity
{
public ItemNotificationSetting Pick { get; set; }
public ItemNotificationSetting Receive { get; set; }
public string ItemId { get; set; }
}
public class ItemNotificationSetting
{
public bool IsEmail { get; set; }
public bool IsNotification { get; set; }
}
下面是我的建設者
modelBuilder.EntitySet<ItemNotification>("ItemNotifications");
感謝所有提前。
感謝您的快速回復,但** Pick **不是導航屬性。所以不能** **擴大**。你看,** Pick **在那裏沒有ID或鑰匙。 – Marcus
@Marcus - 如果您根本不使用'$ select',結果中是否包含'Pick'? – smoksnes
是的:)這是奇怪的事情。結果看起來像這樣{「ItemId」:「123」,「Pick」:{「IsEmail」:true,「IsNotification」:false}} – Marcus