Dear all I have a table with the following columns , Now I have two three rows with Department
Employee Table
Employee Detail table
Now I want to get the employee detail with name Department,salary,Visit_Date I want to get only HR department employee and from HR only one Row whose date is latest date like 8-8-2022
below is my current query.
var MyQuery=(from nn in db.EmployeeDetail
from vv in db.Employee
where vv.Emp_ID=nn.Emp_ID
order by vv.department
select new EmployeeDetail
{
visit_date=nn.Visit_Date,
Salary=nn.Salary).FirstOrDefault(),
}).ToList();
but it return two rows of HR i need one row with latest visit Date.
}