コード例 #1
0
        public DomainObjectTransactionContext(DomainObject domainObject, ClientTransaction associatedTransaction)
        {
            ArgumentUtility.CheckNotNull("domainObject", domainObject);
            ArgumentUtility.CheckNotNull("associatedTransaction", associatedTransaction);
            DomainObjectCheckUtility.CheckIfRightTransaction(domainObject, associatedTransaction);

            _domainObject          = domainObject;
            _associatedTransaction = associatedTransaction;
        }
コード例 #2
0
        /// <summary>
        /// Initializes the <see cref="PropertyAccessor"/> object.
        /// </summary>
        /// <param name="domainObject">The domain object whose property is to be encapsulated.</param>
        /// <param name="propertyData">a <see cref="PropertyAccessorData"/> object describing the property to be accessed.</param>
        /// <param name="clientTransaction">The transaction to be used for accessing the property.</param>
        /// <exception cref="ArgumentNullException">One of the parameters passed to the constructor is <see langword="null"/>.</exception>
        /// <exception cref="ArgumentException">The domain object does not have a property with the given identifier.</exception>
        public PropertyAccessor(IDomainObject domainObject, PropertyAccessorData propertyData, ClientTransaction clientTransaction)
        {
            ArgumentUtility.CheckNotNull("domainObject", domainObject);
            ArgumentUtility.CheckNotNull("propertyData", propertyData);
            ArgumentUtility.CheckNotNull("clientTransaction", clientTransaction);
            DomainObjectCheckUtility.CheckIfRightTransaction(domainObject, clientTransaction);

            _domainObject      = domainObject;
            _clientTransaction = clientTransaction;
            _propertyData      = propertyData;
        }
コード例 #3
0
        public IEnumerable <PropertyAccessor> AsEnumerable([NotNull] ClientTransaction transaction)
        {
            ArgumentUtility.CheckNotNull("transaction", transaction);
            DomainObjectCheckUtility.CheckIfRightTransaction(_domainObject, transaction);

            foreach (PropertyDefinition propertyDefinition in ClassDefinition.GetPropertyDefinitions())
            {
                yield return(this[propertyDefinition.PropertyName, transaction]);
            }

            foreach (IRelationEndPointDefinition endPointDefinition in ClassDefinition.GetRelationEndPointDefinitions())
            {
                if (endPointDefinition.IsVirtual)
                {
                    yield return(this[endPointDefinition.PropertyName, transaction]);
                }
            }
        }