I am working with Entity Framework. I have to apply join of two tables but what I want if there is one table Category with a column categoryid as foreign key which is of integer data type and another table Products with column id as primary key which is also of integer data type.
Now I need to select only those records from Products table which have id which is contained in Category table.
This is my code:
string categoryid= "10,11,12";
datalist.DataSource = (from p in objCategory
join q in objProducts on p.categoryid.contains(q.id)
select new
{
p.FilePath,
p.ItemName,
p.Description,
q.image_url,
q.name,
q.price
}).ToList();