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
649
1.5k
867.1k
LINQ Query Where Clause when join two tables
Mar 11 2019 12:07 AM
When i join two tables using LINQ then it working properly but when i join two tables and i use the Where Clause then the LINQ query does not display any record. Following is my complete Action Method in which i joined two tables one is EmployeeGeneralDetails table and another one is PassportDetails table. Its working without the Where Clause but when i want to display a single record using the Employee ID and i used the Where condition then its not working. Please check my Where clause why its not working. Following is the Action Method:
public IActionResult SearchEmployeePassportInfoByID(string id)
{
var empPassportInfo = from p in dbContext.PassportDetails
join emp in dbContext.EmployeeGeneralDetails on p.EmpCode equals emp.EmpCode
where emp.EmpCode == id
select new RetrieveEmployeePassportDetails
{
EmpCode = p.EmpCode,
EmpFullName = emp.EmpFullName,
IssuingCountry = p.IssuingCountry,
IssueDate = p.IssueDate,
ExpiryDate = p.ExpiryDate
};
return PartialView(empPassportInfo);
}
Reply
Answers (
10
)
Deserializing JSON array into strongly typed .NET object
pie chart is not visible