日期:2014-05-20  浏览次数:21073 次

LINQ to Entities 不识别方法.
LINQ to Entities 不识别方法“System.String HashPasswordForStoringInConfigFile(System.String, System.String)”,因此该方法无法转换为存储表达式。 
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 

异常详细信息: System.NotSupportedException: LINQ to Entities 不识别方法“System.String HashPasswordForStoringInConfigFile(System.String, System.String)”,因此该方法无法转换为存储表达式。
=========================================================================================================
生成代码的时候没提示错误。
用Linq to SQL也不会出错
但是不知道为什么用ADO.NET Entity Data Model就会抱这种错误
求解

------解决方案--------------------
string ss = HashPasswordForStoringInConfigFile(...);
再把ss放LINQ to Entities里用