コード例 #1
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;
        }
コード例 #2
0
 private PropertyAccessor GetPropertyAccessor([NotNull] ClientTransaction transaction, [NotNull] PropertyAccessorData data)
 {
     // PropertyAccesor-ctor checks the argument
     return(new PropertyAccessor(_domainObject, data, transaction));
 }