public async Task <ProfileEntity> SetProfileByGoogleIdAsync([FromBody] GoogleProfileDto googleProfile) { _logger.LogInformation("put: profiles/google"); ProfileEntity profile = this.googleAssembler.AssemblerProfileEntity(googleProfile); await this._profileRepository.AddAsync(profile); this._profileRepository.Save(); return(this._profileRepository.getProfileByGoogleId(googleProfile.id)); }
public ProfileEntity AssemblerProfileEntity(GoogleProfileDto dto) { if (dto.id == null) { throw new Exception("google dto is null"); } ProfileEntity result = new ProfileEntity(); result.GoogleId = dto.id; result.Name = dto.FirstName; return(result); }