Пример #1
0
        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));
        }
Пример #2
0
        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);
        }