Exemple #1
0
        public async Task <ActionResult <ProfileDto> > Register(RegisterData data)
        {
            var user = await userService.Register(data, this.ModelState);

            if (!ModelState.IsValid)
            {
                return(BadRequest(new ValidationProblemDetails(ModelState)));
            }

            CreateProfileDto profile = new CreateProfileDto {
                DisplayName = data.Username
            };

            var profileDto = await profileRepository.CreateProfile(profile, user);

            profileDto = await profileRepository.CreateProfileMember(new CreateProfileMember { ProfileId = profileDto.Id, UserId = user.Id });

            return(Ok(profileDto));
        }
Exemple #2
0
 public async Task <ActionResult <ProfileDto> > PostProfileMember(CreateProfileMember profileMember)
 {
     return(Ok(await profileRepository.CreateProfileMember(profileMember)));
 }