Guest User

Guest User

  • Tech Writer
  • 58
  • 4.7k

The model item passed into the dictionary is of type 'System.Linq.Enum

Mar 15 2022 4:23 AM

after executing the application I am getting an 

"The model item passed into the dictionary is of type 'System.Linq.Enumerable+WhereEnumerableIterator`1[CarMart.Models.carRegistration]', but this dictionary requires a model item of type 'System.Collections.Generic.IEnumerable`1[CarMart.Service.carRegistrationDisplay]'."
 

 public ActionResult CarListByBrand(String brand)
        {
            var _carLit = commonCarRegistrationList(10, 1);
            _carLit = _carLit.Where(i => i.brand == brand && i.primary_Image == true || i.primary_Image == null);
            ViewData.Model = _carLit;

            return View("UsedCarListParent");
        }


Answers (1)