Esempio n. 1
0
        public async Task <GetUserByIdVm> RetrieveAsync(GetUserById query)
        {
            var res = await _userRepository.GetByIdAsync(query.Id);

            return(new GetUserByIdVm
            {
                Id = res.Id,
                Name = res.Name
            });
        }
Esempio n. 2
0
        public async Task <User> UpdateUserAsync(User model)
        {
            //update user
            var user = await userReadRepository.GetByIdAsync(model.Id);

            user.Email = model.Email;

            user.Name      = model.Name;
            user.Surname   = model.Surname;
            user.Birthday  = model.Birthday;
            user.Education = model.Education;
            user.Phone     = model.Phone;
            user.City      = model.City;
            user.LeagueId  = model.LeagueId;

            user.Weight = model.Weight;
            user.Height = model.Height;

            await userWriteRepository.UpdateAsync(user);

            return(user);
        }
Esempio n. 3
0
        public Task <User> GetUserByIdAsync(int id)
        {
            var result = userReadRepository.GetByIdAsync(id);

            return(result);
        }