Skip to main content
 首页 » 编程设计

c#之方法无法转换为 LINQ 中的存储表达式

2024年02月06日16lautakyan007

<分区>

我是 LINQ 的新手,我正在运行一个查询,但我遇到了一些问题,请让我知道我的查询可能有什么问题

    DBContex db = new DBContex (); 
    var APIKey = db.Table.Where(a => a.APIKey == Guid.Parse(AppKey)).SingleOrDefault(); 

错误

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