I need to get a List from a query involving a view. Here’s the code:
IEnumerable<Link> links = _db.Links.Include("User").Include("ModUser");
return View(links.ToList());
My people view has two one-to-many relations to the above Links table, in User and ModUser. The ToList call throws a EntityCommandExecutionException, with “Invalid object name ‘dbo.Person’.” How can I get this data into a list?
I’m such a nube it’s embarrassing. I was trying to access a View named Persons. Way back when it was made they named it People. My DBA changed it and I eventually got it working.