public ProfileDto?AddNewProfile(IAccountModel accountModel) { if (string.IsNullOrEmpty(accountModel.ProfileId)) { return(null); } var profile = _profilesService.Create(accountModel.ToNewProfileEntity()); return(profile?.ToProfileDto()); }
public ProfileDto?UpdateProfile(IAccountModel accountModel) { if ( string.IsNullOrEmpty(accountModel.ProfileId) || string.IsNullOrEmpty(accountModel.Id) ) { return(null); } var updated = _profilesService.UpdatePassively(accountModel.ToNewProfileEntity()); if (updated != null || !string.IsNullOrEmpty(updated?.Id)) { return(updated.ToProfileDto()); } return(null); }