天天看點

【EntityFramework CodeFirst 】錯誤解析:LINQ to Entities does not recognize the method Guid Parse錯誤資訊:原因分析:解決辦法:

錯誤資訊:

System.NotSupportedException:“LINQ to Entities does not recognize the method 'System.Guid Parse(System.String)' method, and this method cannot be translated into a store expression.”

Linq to Entities 不支援 Guid.Parse() 方法

原因分析:

在Linq語句中使用 Guid.Parse() 方法,該方法暫不被 Linq to Entity 支援。

解決辦法:

删除該方法的使用。嘗試直接使用字元串,或改變字元串類型屬性為GUID類型。