我的用戶類如下所示,當我嘗試使用下面的查詢更新記錄時,它給了我例外。無法將類型System.String的值轉換爲OData類型[Edm.Guid Nullable = True]
public class User
{
public User();
public Guid Id { get; set; }
public virtual Language Language { get; set; }
public Guid? LanguageId { get; set; }
public virtual City City { get; set; }
public Guid? CityId { get; set; }
}
代碼
Guid cityId = new Guid("4B1FCCA6-3E43-44BA-8516-BC693F02E9B5");
await myClient.For<User>()
.Filter(t => t.CityId == cityId)
.Set(new { LanguageId = languageId })
.UpdateEntryAsync();
上述更新語句執行後,我得到異常 Unable to convert value of type System.String to OData type [Edm.Guid Nullable=True]
myClient
是Simple Odata client
什麼'myClient'?什麼是'userData'?你在哪裏得到錯誤? – Backs
更新的問題與詳情 – Neo
局部變量'languageId'的類型是什麼? – lencharest