官方文档:http://msdn.microsoft.com/zh-cn/library/dd456847(v=vs.110).aspx
其它参考:
该SQL函数名称为f_BuildFilter并有两个参数,返回值为字符类型。下面是调用该函数的代码: private string GetFilterExpression(int filterID) { using (CEntities ce = Connection.Entities) { var query = ce.CreateQuery<string>("CModel.Store.f_BuildFilter(@FilterID,@ForAccess)"); query.Parameters.Add(new ObjectParameter("FilterID", filterID)); query.Parameters.Add(new ObjectParameter("ForAccess",false)); return query.Execute(MergeOption.AppendOnly).FirstOrDefault(); } }