Esempio n. 1
0
        /// <summary>
        /// Does a logical negation of the operator.
        /// </summary>
        /// <returns>The resulting operator.</returns>
        public IOperator LogicallyNegate()
        {
            if (Operator == ExpressionType.Not)
            {
                return(InternalOperator);
            }

            InternalOperator = InternalOperator.LogicallyNegate();
            return(this);
        }
Esempio n. 2
0
        /// <summary>
        /// Optimizes the operator based on the mapping source.
        /// </summary>
        /// <param name="mappingSource">The mapping source.</param>
        /// <returns></returns>
        public IOperator Optimize(IMappingSource mappingSource)
        {
            InternalOperator = InternalOperator.Optimize(mappingSource);
            if (InternalOperator is null)
            {
                return(null !);
            }

            return(Operator == ExpressionType.Not ? InternalOperator.LogicallyNegate() : (this));
        }
Esempio n. 3
0
        /// <summary>
        /// Optimizes the operator based on the mapping source.
        /// </summary>
        /// <param name="mappingSource">The mapping source.</param>
        public IOperator Optimize(IMappingSource mappingSource)
        {
            if (InternalOperator is null)
            {
                return(this);
            }

            var IsValid = mappingSource.GetChildMappings(ObjectType).Any();

            InternalOperator = IsValid ?
                               InternalOperator.Optimize(mappingSource) :
                               null;
            if (InternalOperator?.TypeCode != typeof(bool))
            {
                InternalOperator = null;
            }

            return(this);
        }
Esempio n. 4
0
 /// <summary>
 /// Copies this instance.
 /// </summary>
 /// <returns>A copy of this instance.</returns>
 public IOperator Copy() => new UnaryOperator(InternalOperator.Copy(), Operator, TypeCode);
Esempio n. 5
0
 /// <summary>
 /// Sets the column names.
 /// </summary>
 /// <param name="mappingSource">The mapping source.</param>
 /// <param name="mapping">The mapping.</param>
 public void SetColumnNames(IMappingSource mappingSource, IMapping mapping) => InternalOperator?.SetColumnNames(mappingSource, mapping);
Esempio n. 6
0
 /// <summary>
 /// Gets the parameters associated with the operator.
 /// </summary>
 /// <returns>A list of parameters associated with the operator.</returns>
 public List <IParameter> GetParameters() => InternalOperator.GetParameters();
Esempio n. 7
0
 /// <summary>
 /// Does a logical negation of the operator.
 /// </summary>
 /// <returns>The resulting operator.</returns>
 public IOperator LogicallyNegate()
 {
     InternalOperator = InternalOperator?.LogicallyNegate();
     return(this);
 }
Esempio n. 8
0
 /// <summary>
 /// Gets the parameters associated with the operator.
 /// </summary>
 /// <returns>A list of parameters associated with the operator.</returns>
 public List <IParameter> GetParameters() => InternalOperator is null ? new List <IParameter>() : InternalOperator.GetParameters();
Esempio n. 9
0
 /// <summary>
 /// Copies this instance.
 /// </summary>
 /// <returns>A copy of this instance.</returns>
 public IOperator Copy() => new WhereClause <TObject>(InternalOperator?.Copy());