public ActionResult Index(string Id) { if (Id == null) { Id = ""; } IEnumerable <Flight> Lflights = con.GetAllFlights(); if (!string.IsNullOrEmpty(Id) && Id != "All") { Lflights = Lflights.Where(p => p.F_Name.ToLower() == Id.ToLower()); } return(View(Lflights)); }
public ActionResult Flights(string F_Id) { if (F_Id == null) { F_Id = ""; } IEnumerable <Flight> ListFlights = dalobj.GetAllFlights(); // IEnumerable<Product> products = repo.GetProducts(); if (!string.IsNullOrEmpty(F_Id) && F_Id != "All") { ListFlights = ListFlights.Where(p => p.F_Name.ToLower() == F_Id.ToLower()).OrderByDescending(x => x.F_Id); } return(View(ListFlights)); }