public long Add(CheckingAccount checkingAccount) { checkingAccount.Client = _clientRepository.GetById(checkingAccount.Client.Id) ?? throw new NotFoundException(); checkingAccount = _checkingAccountRepository.Add(checkingAccount); return(checkingAccount.Id); }
public long Add(CheckingAccountRegisterCommand cmd) { var checkingAccount = Mapper.Map <CheckingAccountRegisterCommand, CheckingAccount>(cmd); checkingAccount.Client = _clientRepository.GetById(cmd.Client.Id) ?? throw new NotFoundException(); var newCheckingAccount = _checkingAccountRepository.Add(checkingAccount); return(checkingAccount.Id); }