Beispiel #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ValueRule"/> class.
        /// </summary>
        /// <param name="columnName">Name of the column.</param>
        /// <param name="valueFactory">The value factory.</param>
        /// <param name="appliesWhen">The applies when.</param>
        /// <exception cref="ArgumentOutOfRangeException">appliesWhen;appliesWhen may only be a combination of Insert, Update, or Delete</exception>
        public ValueRule(string columnName, ColumnValueGenerator valueFactory, OperationTypes appliesWhen) : base(columnName, appliesWhen)
        {
            if (appliesWhen.HasFlag(OperationTypes.Select))
                throw new ArgumentOutOfRangeException("appliesWhen", appliesWhen, "appliesWhen may only be a combination of Insert, Update, or Delete");

            ValueFactory = valueFactory;
        }
Beispiel #2
0
    /// <summary>
    /// Initializes a new instance of the <see cref="ValueRule"/> class.
    /// </summary>
    /// <param name="columnName">Name of the column.</param>
    /// <param name="valueFactory">The value factory.</param>
    /// <param name="appliesWhen">The applies when.</param>
    /// <exception cref="ArgumentOutOfRangeException">appliesWhen;appliesWhen may only be a combination of Insert, Update, or Delete</exception>
    public ValueRule(string columnName, ColumnValueGenerator valueFactory, OperationTypes appliesWhen) : base(columnName, appliesWhen)
    {
        if (appliesWhen.HasFlag(OperationTypes.Select))
        {
            throw new ArgumentOutOfRangeException(nameof(appliesWhen), appliesWhen, "appliesWhen may only be a combination of Insert, Update, or Delete");
        }

        ValueFactory = valueFactory;
    }