public override async Task <AddAccountLoginServiceResponse> Handle(AddAccountLoginServiceRequest request) { var accountLogin = AccountLogin.CreateAndInitializeAccount(request.Username); AccountContext.AccountLogins.Add(accountLogin); await AccountContext.Save(); return(Mapper.Map <AddAccountLoginServiceResponse>(accountLogin)); }
public async override Task <UpdateAccountLoginServiceResponse> Handle(UpdateAccountLoginServiceRequest request) { await CheckUsername(request.AccountNewUsername); var account = await GetAccount(request.AccountUsername); account.UpdateLogin(request.AccountNewUsername); await AccountContext.Save(); return(Mapper.Map <UpdateAccountLoginServiceResponse>(account.Login)); }