Example #1
0
        public IColumnMap Ignore(SqlOperation behavior = SqlOperation.Insert | SqlOperation.Update | SqlOperation.Select)
        {
            if (behavior.HasFlag(SqlOperation.Select))
            {
                if (Behavior.HasFlag(ColumnBehavior.Key))
                {
                    throw new InvalidOperationException($"Column '{ColumnName}' cannot ignore select operations because it is a key.");
                }
                if (Behavior.HasFlag(ColumnBehavior.Generated))
                {
                    throw new InvalidOperationException($"Column '{ColumnName}' cannot ignore select operations because it is generated.");
                }
            }

            IgnoreOperations |= behavior;

            return(this);
        }