public async Task <EmailDto> CreateAsync(CreateUpdateEmailDto input) { var email = await _emailManager.CreateAsync( input.EmailString, input.Password, input.Order ); await _emailRepository.InsertAsync(email); return(ObjectMapper.Map <Email, EmailDto>(email)); }
public async Task UpdateAsync(Guid id, CreateUpdateEmailDto input) { var email = await _emailRepository.GetAsync(id); if (email.EmailString != input.EmailString) { await _emailManager.ChangeNameAsync(email, input.EmailString); } email.Password = input.Password; await _emailRepository.UpdateAsync(email); }