Ejemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="OrderByModel"/> for the specified <see cref="FieldRefModel"/>.
        /// </summary>
        /// <param name="fieldRef">FieldRef to order.</param>
        /// <param name="ascending">Is ascending ordering.</param>
        public OrderByModel([NotNull] FieldRefModel fieldRef, bool ascending)
        {
            Guard.CheckNotNull(nameof(fieldRef), fieldRef);

            FieldRef  = fieldRef;
            Ascending = ascending;
        }
Ejemplo n.º 2
0
 public static WhereModel In([NotNull] FieldRefModel field, [CanBeNull] IEnumerable <object> values)
 {
     values = values ?? new object [0];
     return(values.Aggregate <object, WhereModel>(null, (where, value) => {
         var spDataComparison = new ComparisonModel(ComparisonOperator.Eq, field, value);
         return Or(@where, spDataComparison);
     }));
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ComparisonModel"/>
        /// </summary>
        /// <param name="comparisonOperator">Comparison operator.</param>
        /// <param name="field">Comparable FieldRef model.</param>
        /// <param name="value">Value that is expected. Can be null.</param>
        /// <exception cref="ArgumentNullException"><paramref name="field"/> is null.</exception>
        public ComparisonModel(ComparisonOperator comparisonOperator, [NotNull] FieldRefModel field,
                               [CanBeNull] object value)
            : base(WhereType.Comparison)
        {
            Guard.CheckNotNull(nameof(field), field);

            ComparisonOperator = comparisonOperator;
            Field = field;
            Value = value;
        }