public ActionResult SearchSwapper(SwapperSearch SwapMod) { try { if (SwapMod.txt.Equals("")) { SwapMod.res = service.GetAll(); SwapMod.txt = ""; System.Diagnostics.Debug.WriteLine(" ********* Search Is empty "); SwapMod.txt = ""; return(View(SwapMod)); } SwapMod.res = service.GetMany(c => c.firstname.Contains(SwapMod.txt) || c.lastname.Contains(SwapMod.txt)); // System.Diagnostics.Debug.WriteLine("------------------------------------ : " + service.GetMany(c => c.firstname.Equals("XX")).Count()); SwapMod.txt = ""; return(View(SwapMod)); } catch (Exception exp) { SwapMod.res = service.GetAll(); SwapMod.txt = ""; System.Diagnostics.Debug.WriteLine(" ********* Search Is empty "); SwapMod.txt = ""; return(View(SwapMod)); } }
public SwapperSearch() { res = service.GetAll(); }