private void BindBag(long?awbId) { ViewBag.AwbId = awbId; ViewBag.Brokers = _brokers.GetAll().ToDictionary(x => (long?)x.Id, x => x.Name); ViewBag.Senders = _senders.GetAll().ToDictionary(x => (long?)x.UserId, x => x.Name); }
public UserListItem[] List(RoleType role) { switch (role) { case RoleType.Manager: return(_managers.GetAll().Select( x => new UserListItem { Name = x.Name, EntityId = x.EntityId, UserId = x.UserId }).ToArray()); case RoleType.Admin: return(_admins.GetAll().Select( x => new UserListItem { Name = x.Name, EntityId = x.EntityId, UserId = x.UserId }).ToArray()); case RoleType.Broker: return(_brokers.GetAll().Select( x => new UserListItem { Name = x.Name, EntityId = x.Id, UserId = x.UserId }).ToArray()); case RoleType.Forwarder: return(_forwarders.GetAll().Select( x => new UserListItem { Name = x.Name, EntityId = x.Id, UserId = x.UserId }).ToArray()); case RoleType.Carrier: return(_carriers.GetAll().Select( x => new UserListItem { Name = x.Name, EntityId = x.Id, UserId = x.UserId }).ToArray()); case RoleType.Sender: return(_senders.GetAll().Select( x => new UserListItem { Name = x.Name, EntityId = x.EntityId, UserId = x.UserId }).ToArray()); default: throw new ArgumentOutOfRangeException("role"); } }
public async Task GetAll_ShouldNotReturnNull() { var result = await _brokerRepositoryMock.GetAll(); Assert.IsNotNull(result); }
public IEnumerable <BrokerViewModel> GetAll() { return(_brokerRepository.GetAll().ProjectTo <BrokerViewModel>(_mapper.ConfigurationProvider)); }
/// <summary> /// Get all the properties /// </summary> /// <returns>Task that returns a list of BrokerDTO</returns> public async Task <List <BrokerDTO> > GetAll() { var propertiesList = await _repository.GetAll(); return(Mapper.Map <List <Broker>, List <BrokerDTO> >(propertiesList)); }
public async Task <ActionResult <List <BrokerViewModel> > > Get() { return(_mapper.Map <List <BrokerViewModel> >(await _brokerRepository.GetAll())); }