Sunday, June 2, 2019

LINQ Status with Any and condition in firstOrDefault

1. Status by Any
     bool status = db.Employee.Any(x => x.emp_id == 1);

2. Condtion in FirstOrDefault
     Employee employee = db.Employee.FirstOrDefault(x => x.emp_id == 1);

No comments:

Post a Comment

Linq Expression syntax for where condtion in linq

(Expression<Func<T, bool>> filter)