public ViewResult Index() { SimplePilot Sp = new SimplePilot(_context); var model = Sp.GetAllPilots(); return(View(model)); }
public ViewResult Index(string name) { SimplePilot Sp = new SimplePilot(_context); IEnumerable <PilotDto> model = null; if (string.IsNullOrEmpty(name) || string.IsNullOrEmpty(name)) { model = Sp.GetAllPilots(); } else { model = Sp.GetPilotByName(name); } return(View(model)); }