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.
Abhilash J APosted Jun 12, 2017, 8:34 AM
Rishabh SinghPosted Jun 12, 2017, 8:06 AM
Abhilash J APosted Jun 12, 2017, 7:09 AM
masterProduct.brandnames = (from brand in Brand join product in Product on brand.idproduct equls product.idproduct).ToList();
Rajkiran SwainPosted Jun 12, 2017, 7:03 AM