0

How can I convert 'ISNULL' condition in linq query syntax

Where ISNULL(p.FirstName,'') = '' AND ISNULL(p.LastName,'') = '' AND ISNULL(p.IsDeleted,0) = 0

AJMi
  • 33
  • 7
  • 1
    That's a **bad** SQL query. It should be `Where p.FirstName IS NULL`. Using a function on a field means no indexes can be used as the server has to process *all* rows to calculate the function's output – Panagiotis Kanavos Jan 07 '21 at 09:54
  • If you want to match either NULL or an empty string, write it explicitly, both in SQL and LINQ – Panagiotis Kanavos Jan 07 '21 at 09:56

0 Answers0