How to select query on table via a function
I tried this syntax but it does not work.
I would like to know the correct syntax
public ActionResult GetName(string name)
{
if (!string.IsNullOrWhiteSpace(name))
{
List<Models.table> resultats = db.table.Where(table => db.table.Nom_de_site == name).ToList();
return Json(resultats, JsonRequestBehavior.AllowGet);
}
return null;
}