How can I query a view with data in a list?
For eg: Below, I have variable “data” where I store all the id’s from a view to a list. I want to query a second view “vwStatus” such that it returns all the rows which has status displayed in the list(data)
Something like:
public ActionResult Index(string id)
{
var data = (from p in db.vwdb.Where(p => p.ID == id)
group p by p.status into g select g.Key).ToList();
ViewData.Model = db.vwStatus.Where(p => p.Status == data);
return View();
}
Hope I made it clear.
You can do this:
This shall work fine.
Regards.