public bool HasOwnerAccountByType(IAccountOwner accountOwner, AccountTypeDomainEntity accountType) { int ownerType = accountOwner.OwnerType.ToInt(); return(Exists( a => a.OwnerId == accountOwner.OwnerId && a.OwnerType == ownerType && a.AccountTypeId == accountType.AccountTypeId)); }
public AccountDomainEntity With( AccountTypeDomainEntity accountType, IAccountOwner accountOwner, string accountNumber) { AccountType = accountType ?? throw new CommonException.RequiredParameterMissingException(nameof(accountType)); AccountOwner = accountOwner ?? throw new CommonException.RequiredParameterMissingException(nameof(accountType)); AccountNumber = string.IsNullOrWhiteSpace(accountNumber) ? throw new CommonException.RequiredParameterMissingException(nameof(accountNumber)) : accountNumber; accountRepository.InsertEntity(this); return(this); }