public async Task <ShipmentViewModel> CreateAsync(ShipmentViewModel model) { var viewModel = _mapper.Map <ShipmentViewModel>(model); var shippers = await _shipperService.GetAllAsync(); var shipperListItems = shippers.Select(s => new SelectListItem { Value = s.Id, Text = s.CompanyName, Selected = s.Id == model.ShipperEntityId }); viewModel.Shippers = shipperListItems; return(viewModel); }
public async Task <IHttpActionResult> GetAllProducts() { var shipper = await _shipperService.GetAllAsync(); return(Ok(shipper)); }