public async Task <UserColourAges> GetUsers() { var usersDto = await _repository.GetUsersAsync(); var mappedUsers = _mapper.Map <List <UserDto>, List <User> >(usersDto); List <Colour> colors = GetColours(mappedUsers); List <Age> ages = GetAges(mappedUsers); var model = new UserColourAges { Users = mappedUsers, Ages = ages, TopColours = colors }; return(model); }
public async Task SaveUsers(UserColourAges model) { var mapped = _mapper.Map <UserColourAges, UserColourAgesDto>(model); await _repository.SaveUsersAsync(mapped); }