As part of my search page I am allowing the user to make a multi-select on specific search terms using the KendoUI Multiselect widget. These items in the collection are passed to my controller as a parameter. My question is, after I have passed them to my controller how do I use them? more specifically how do I use them in my Where statement which uses the Contains method.
Here is my code for the multi select widget
@(Html.Kendo().MultiSelect() .Name("vessel_type") .Placeholder("Select Type") .BindTo(new List<string>() { "AHTS", "PSV", "Special" })) Here is my controller code which uses the vessel_type as a parameter
public ActionResult Search(IEnumerable<string> vessel_type) { var vessels = (from o in db.vessels select o); vessels = vessels.Where(s => s.vessel_type.Contains(vessel_type)); return PartialView("_results", vessels); } This line isn't correct because it's expecting a string but I have a collection of mroe than one:
vessels = vessels.Where(s => s.vessel_type.Contains(vessel_type)); Thanks
s.vessel_type?