I keep getting an error and I can't figure out the source of it. I'm trying to do a simple image upload connected to an item and when trying to pull the list I get the following error:
The entity or complex type ' ' cannot be constructed in a LINQ to Entities query
public ActionResult Index()
{
var content = db.Items.Select(s => new
{
s.Id,
s.Image,
s.Price,
s.Quantity,
});
List<Item> contentModel = content.Select(item => new Item()
{
Id = item.Id,
Image = item.Image,
Price = item.Price,
Quantity = item.Quantity,
}).ToList();
return View(contentModel);
}