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();
    */

      

  • 相关阅读:
    DOM
    ES6的export和import
    JavaScript:Location
    垃圾回收机制之一:标记删除算法
    KnockoutJS:
    package.json
    2016/7/27
    requirejs:研究笔记
    postmessage/cors跨域postMessage、xhr2和xmldomain
    javascript:算法之数组sort排序
  • 原文地址:https://www.cnblogs.com/valeb/p/7444720.html
Copyright © 2011-2022 走看看