예제 #1
0
        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);
        }
예제 #2
0
        public async Task SaveUsers(UserColourAges model)
        {
            var mapped = _mapper.Map <UserColourAges, UserColourAgesDto>(model);

            await _repository.SaveUsersAsync(mapped);
        }