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

Raw Insert query in EF8 or Entity Framwork 8

          public async Task<object> InsertRack(Rack RackInsert)         {             try             {                 sql = " i...