public ActionResult Index(int?orderId = null) { IQueryable <Shipment> shipments = orderId.HasValue ? shipmentService.FindByOrder(orderId.Value) : shipmentService.FindAll(); var model = Mapper.Map <List <ShipmentIndexViewModel> >(shipments.OrderByDescending(s => s.Id)); return(View(model)); }