question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SqlMethods.Like equivalent in EF7

See original GitHub issue

In EF6, we can perform a SQL LIKE enquiry by writing

SqlMethods.Like(dbProductMaster.ProductName.ToLower(), "%" + searchProductName.ToLower() + "%"))

and it will translate to

SELECT * FROM ProductMaster WHERE ProductName LIKE '%xxx%'; 

What should I do to perform the same query under EF7?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
dmitry-pavlovcommented, Sep 29, 2017

EF.Functions.Like() is here in EF Core 2.0 by the way

0reactions
rowanmillercommented, Oct 5, 2015
Read more comments on GitHub >

github_iconTop Results From Across the Web

SqlMethods.Like equivalent in EF7 · Issue #3325
In EF6, we can perform a SQL LIKE enquiry by writing SqlMethods.Like(dbProductMaster.ProductName.ToLower(), "%" + searchProductName.
Read more >
How to use LIKE Operator in LINQ to Entity Framework
I'm using Entity Framework. Problem: search a name that start with 'a' in a list of strings: var likeQuery = from k in...
Read more >
SqlMethods.Like Method (System.Data.Linq.SqlClient)
Determines whether a specific character string matches a specified pattern. This method is currently only supported in LINQ to SQL queries.
Read more >
Database Functions - EF Core
Information on database functions supported in EF Core query translation.
Read more >
Querying in Entity Framework Core
Querying in Entity Framework Core remains the same as in EF 6.x, with more optimized SQL queries and the ability to include C#/VB.NET...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found