zoukankan      html  css  js  c++  java
  • EF LIKE 查询

        <!-- CSDL content -->
        <edmx:ConceptualModels>
          <Schema Namespace="CallCentersModel" Alias="Self" p1:UseStrongSpatialTypes="false" xmlns:annotation="http://schemas.microsoft.com/ado/2009/02/edm/annotation" xmlns:p1="http://schemas.microsoft.com/ado/2009/02/edm/annotation" xmlns="http://schemas.microsoft.com/ado/2009/11/edm">
           
    
     <Function Name="String_Like" ReturnType="Edm.Boolean">
              <Parameter Name="searchingIn" Type="Edm.String" />
              <Parameter Name="lookingFor" Type="Edm.String" />
              <DefiningExpression>
                searchingIn LIKE lookingFor
              </DefiningExpression>
            </Function>
    

      在edmx  文件中添加  Function 节点

        public static class EdmxExtensions
        {
            [EdmFunction("CallCentersModel", "String_Like")]
            public static Boolean Like(this String searchingIn, String lookingFor)
            {
                throw new Exception("Not implemented");
            }
        }
    

      

    /*
    string codeLike = id + "%";
    var model = db.GetListByWhere(s => s.Code.Like(codeLike), s => new { s.Code, s.ProductID }, false).FirstOrDefault();
    */

      

  • 相关阅读:
    vue与react的区别
    for(key in obj)
    github上传项目
    第一个blog
    黑客几乎绝不用鼠标?
    中国白帽黑客调查
    编程新手六部曲
    程序猿看了要xiao了
    程序是如何执行的?
    IT 技术人需要思考的 15 个问题
  • 原文地址:https://www.cnblogs.com/valeb/p/7444720.html
Copyright © 2011-2022 走看看