I have an Asynchronous Action method in which i used async and Task. Now i want to use await statement in it but when i use await statement it gives me error. Following is my Action method:
public async Task<IActionResult> SearchAllEmployees()
{
var empRecord = from emp in dbContext.EmployeeGeneralDetails
join c in dbContext.Countries on emp.EmpNationality equals c.CountryCode
join b in dbContext.Branches on emp.EmpBranchCode equals b.BranchCode
join d in dbContext.Departments on emp.EmpDepttCode equals d.DepartmentID
select new RetrieveEmployeeDetails
{
EmpCode = emp.EmpCode,
EmpFullName = emp.EmpFullName,
EmpBirthDate = emp.EmpBirthDate,
EmpGender = emp.EmpGender,
EmpJoiningDate = emp.EmpJoiningDate,
EmpMobileNumber = emp.EmpMobileNumber,
EmpEmailAddress = emp.EmpEmailAddress,
EmpPicture = emp.EmpPicture,
CountryName = c.CountryName,
BranchName = b.BranchName,
DepartmentName = d.DepartmentName
};
return PartialView(empRecord);
}