I'm trying to dynamically generate a model property in my Lambda express. In my controller I have the following method:
public ActionResult FilterSubCategory(string filter, string selected)
{
IList<Item> model = db.Items.Where(p => p.Make == selected).ToList();
var viewModel = Mapper.Map<IList<ItemViewModel>>(model);
return View("~/Views/Phone/Index.cshtml", viewModel);
}
I want to use this method to filter my page's column so I'm passing the filter(model property to filter) and the actual selected property value.
I want to replace the 'Make' ('hardcoded' here) here with the value of the filter string passed. Is there a way to do this?