linq data from sql table
How to fetch data from table if customer pass null value as input feild?,I have data in my tabled with value null. I want to pass is null in linq
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jaimin ShethiyaPosted Mar 22, 2021, 4:44 AM
you can just write the below line
var customerList = _context.Customers.Where(x=> x.Name == null || x.Name == string.Empty).ToList();
Thanks
Rijwan AnsariPosted Mar 15, 2021, 1:03 PM
Satya KarkiPosted Mar 15, 2021, 12:29 PM
Jignesh KumarPosted Mar 15, 2021, 11:54 AM
Kiran MohantyPosted Mar 15, 2021, 11:24 AM
Sachin SinghPosted Mar 15, 2021, 10:39 AM