TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Adalat Khan
651
1.5k
866.1k
Async and await Problem
Mar 2 2019 5:42 AM
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);
}
Please explain in the above Action method where i can use the await statement.
Reply
Answers (
2
)
Tables joining using LINQ
Searching through Multiple Dropdownlist