I want to filter the grid view by Id, but something error in my syntax
This my HomeController:
public ActionResult Index(int searching)
{
return View(db.ex_op.Where( x => x.id_ats.Contains(searching) || searching = null).ToList());
}
this my HomeView:
@using (Html.BeginForm("Index", "Home", FormMethod.Get))
{
@Html.TextBox("searching")
<input type="submit" value="Search" />
}
this my Error:
'int' does not contain a definition for 'Contains' and the best extension method overload 'Queryable.Contains(IQueryable,int)' requires a receiver of type 'IQueryable' ```
Thank you so much!