Does Dapper support the like operator?

后端 未结 4 2081
遇见更好的自我
遇见更好的自我 2021-01-30 12:19

Using Dapper-dot-net...

The following yields no results in the data object:

var data = conn.Query(@\"
    select top 25 
    Term as Label, 
    Type, 
          


        
4条回答
  •  我在风中等你
    2021-01-30 13:04

    Best way to use this to add concat function in query as it save in sql injecting as well, but concat function is only support above than sql 2012

    string query = "SELECT * from country WHERE Name LIKE CONCAT('%',@name,'%');"
    var results = connection.query(query, new {name});
    

提交回复
热议问题