How can I translate
select * from employees where (emp_id=@emp or @emp is null) and (dep_id=@dep or @dep is null)
to a LINQ statment?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
C#
I’m assuming the
@emp is nullpart is a typo, and you wantedemp_id is null. If not, just switch it around.I’d suggest reading some more on LINQ.