Example #1
0
        /// <summary>Returns whether or not the constraint needs to be validated given the specified value flags.</summary>
        public override bool ShouldValidate(BitArray valueFlags, Schema.Transition transition)
        {
            switch (transition)
            {
            case Transition.Insert:
                if ((_insertColumnFlags != null) && (valueFlags != null))
                {
                    for (int index = 0; index < _insertColumnFlags.Length; index++)
                    {
                        if (_insertColumnFlags[index] && valueFlags[index])
                        {
                            return(true);
                        }
                    }
                    return(false);
                }
                return(true);

            case Transition.Update:
                if ((_updateColumnFlags != null) && (valueFlags != null))
                {
                    for (int index = 0; index < _updateColumnFlags.Length; index++)
                    {
                        if (_updateColumnFlags[index] && valueFlags[index])
                        {
                            return(true);
                        }
                    }
                    return(false);
                }
                return(true);

            case Transition.Delete:
                if ((_deleteColumnFlags != null) && (valueFlags != null))
                {
                    for (int index = 0; index < _deleteColumnFlags.Length; index++)
                    {
                        if (_deleteColumnFlags[index] && valueFlags[index])
                        {
                            return(true);
                        }
                    }
                    return(false);
                }
                return(true);

            default: return(true);
            }
        }
Example #2
0
        /// <summary>Returns whether or not the constraint needs to be validated given the specified value flags.</summary>
        public override bool ShouldValidate(BitArray valueFlags, Schema.Transition transition)
        {
            if ((_columnFlags != null) && (valueFlags != null))
            {
                for (int index = 0; index < _columnFlags.Length; index++)
                {
                    if (_columnFlags[index] && valueFlags[index])
                    {
                        return(true);
                    }
                }
                return(false);
            }

            return(true);
        }