我从我的数据库中生成一个模型。
在.edmx文件中,我有一个行字符串
<Function Name="GetUniqueInt" ReturnType="int" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="true" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo" />
是其原因?
答案 0 :(得分:2)
您需要在某处创建stub method for your function。它应该看起来像:
[EdmFunction("YourModelNamespace", "GetUniqueInt")]
public static int GetUniqueInt()
{
throw new NotSupportedException("Direct calls are not supported.");
}
将此方法放在上下文类中,并在LINQ查询中使用它。