public ActionResult Orders(Guid?id = null) { var model = new QueryService().GetOrders().ToList(); if (id.HasValue && model.Any()) { var exist = model.FirstOrDefault(m => m.OrderId == id); if (exist != null) { model.Remove(exist); } } return(View(model)); }