My Controller is :-
ViewBag.categoryfilter = _context.MasterProductCategory.Include(u => u.MasterProduct).ThenInclude(u => u.Brand)
.Where(u => u.MasterProduct.ProductName.Contains(search)).ToList();
Where as MasterProduct is related with MasterProductCategory table on :-
public virtual ICollection MasterProduct { get; set; }
Hence Under the Product Name Word it is showing Error. And In My view Page:-
@if (ViewBag.categoryfilter != null)
{
@foreach (var items in ViewBag.categoryfilter)
{
@foreach (var item in ViewBag.categoryfilter)
{
}
incval++;
}
}
These Are my codes to bind the category and respected brand on the basis of prodeuctname.
I am using VS2017 with asp.net-core Please Guide me with suitable solution to bind it properly.

Rajkiran SwainRank #165 · 14.4K reputationPosted Jun 12, 2017, 3:03 AM EDT
Abhilash J ARank #1,243 · 1.4K reputationPosted Jun 12, 2017, 3:09 AM EDT
masterProduct.brandnames = (from brand in Brand join product in Product on brand.idproduct equls product.idproduct).ToList();
Rishabh Singh10 reputationPosted Jun 12, 2017, 4:06 AM EDT
Abhilash J ARank #1,243 · 1.4K reputationPosted Jun 12, 2017, 4:34 AM EDT