Ejemplo n.º 1
0
 /// <summary>
 /// Filters a sequence of values based on a condition.
 /// </summary>
 /// <param name="source">A number collection to filter.</param>
 /// <param name="condition">The condition.</param>
 /// <returns>A number collection that contains elements from the input sequence that satisfy the condition.</returns>
 public static IEnumerable <int> Where(this IEnumerable <int> source, Int32Condition condition)
 {
     if (condition == null)
     {
         return(source);
     }
     return(source.Where(ele => condition.IsMatched(ele)));
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the PropertyCriteria class.
        /// </summary>
        /// <param name="name">The property name.</param>
        /// <param name="op">The operator.</param>
        /// <param name="value">The value of property.</param>
        /// <remarks>You can use this to initialize an instance for the class.</remarks>
        public PropertyCriteria(string name, BasicCompareOperator op, int value)
        {
            Name = name;
            var ope = ToOperator(op);

            Condition = new Int32Condition {
                Operator = ope, Value = value
            };
        }