Exemplo n.º 1
0
        public ProfileResponseDto UpdateProfile(int pid, ProfileInputDto profileInputDto)
        {
            profileInputDto.Validate();

            var profile = _profileMapper.map(profileInputDto);

            return(_profileMapper.map(_profilesRepository.Update(pid, profile)));
        }
        public async Task <IActionResult> Put([FromBody] Profile profile)
        {
            var existingProfile = await profilesRepository.GetAsync(profile.Id);

            if (existingProfile == null)
            {
                return(NotFound());
            }

            existingProfile.Ref         = profile.Ref;
            existingProfile.Forename    = profile.Forename;
            existingProfile.Surname     = profile.Surname;
            existingProfile.Email       = profile.Email;
            existingProfile.DateOfBirth = profile.DateOfBirth;
            existingProfile.TelNo       = profile.TelNo;

            profilesRepository.Update(existingProfile);

            return(Ok());
        }