Last post May 18, 2018 11:51 AM by DA924
May 18, 2018 04:35 AM|veezo2007pk|LINK
I want to get data from two tables using web api, but I'm receiving an error.
Here is my code:
public List<tblEmpTask> GettblEmpTasks()
var q = (from n in db.tblEmpTasks
join c in db.tblEmployees on n.intEmpCode equals c.intEmpCode
Here is the error that I'm receiving:
The type of one of the expressions in the join clause is incorrect. Type inference failed in the call to 'Join'.
and please note that I am using web api. Looking forward to solve this issue.
May 18, 2018 11:38 AM|mgebhard|LINK
Your question is about Entity Framework not Web API. The error is telling you that the types you are trying to JOIN are not the same type and therefore cannot be used. Other than explaining the error there is not much we can do without understanding how
your tables are configured. Maybe there is a null value causing the issue?
May 18, 2018 11:51 AM|DA924|LINK
So when you get the join to work are you planning on sending the data back to the client that is calling the WebAPI that is using EF?