Class Agg
Static helper for creating aggregate expressions in Select
Allows writing: .Select(x => new { Total = Agg.Sum(x.Props.Price) })
public static class Agg
Inheritance
Methods
Average(decimal?)
public static decimal Average(decimal? value)
Average(double)
public static double Average(double value)
Average(IEnumerable<decimal>)
Average value from a collection (for arrays)
public static decimal Average(IEnumerable<decimal> values)
Average(IEnumerable<double>)
public static double Average(IEnumerable<double> values)
Average(IEnumerable<int>)
public static double Average(IEnumerable<int> values)
Average(IEnumerable<long>)
public static double Average(IEnumerable<long> values)
Average(int)
public static double Average(int value)
Average(long)
public static double Average(long value)
Average<TKey, TProps, TValue>(IRedbGrouping<TKey, TProps>, Expression<Func<TProps, TValue>>)
Average in a group: Agg.Average(g, x => x.Age)
public static double Average<TKey, TProps, TValue>(IRedbGrouping<TKey, TProps> group, Expression<Func<TProps, TValue>> selector) where TProps : class, new()
Count<T>(IEnumerable<T>)
Count of elements in a collection
public static int Count<T>(IEnumerable<T> values)
Count<TKey, TProps>(IRedbGrouping<TKey, TProps>)
Count in a group: Agg.Count(g)
public static int Count<TKey, TProps>(IRedbGrouping<TKey, TProps> group) where TProps : class, new()
Max<TKey, TProps, TValue>(IRedbGrouping<TKey, TProps>, Expression<Func<TProps, TValue>>)
Maximum in a group: Agg.Max(g, x => x.Price)
public static TValue Max<TKey, TProps, TValue>(IRedbGrouping<TKey, TProps> group, Expression<Func<TProps, TValue>> selector) where TProps : class, new()
Min<TKey, TProps, TValue>(IRedbGrouping<TKey, TProps>, Expression<Func<TProps, TValue>>)
Minimum in a group: Agg.Min(g, x => x.Price)
public static TValue Min<TKey, TProps, TValue>(IRedbGrouping<TKey, TProps> group, Expression<Func<TProps, TValue>> selector) where TProps : class, new()
Sum(decimal?)
public static decimal Sum(decimal? value)
Sum(double?)
public static double Sum(double? value)
Sum(double)
public static double Sum(double value)
Sum(IEnumerable<decimal?>)
public static decimal Sum(IEnumerable<decimal?> values)
Sum(IEnumerable<decimal>)
Sum of values from a collection (for arrays)
public static decimal Sum(IEnumerable<decimal> values)
Sum(IEnumerable<double>)
public static double Sum(IEnumerable<double> values)
Sum(IEnumerable<int>)
public static int Sum(IEnumerable<int> values)
Sum(IEnumerable<long>)
public static long Sum(IEnumerable<long> values)
Sum(int?)
public static int Sum(int? value)
Sum(int)
public static int Sum(int value)
Sum(long?)
public static long Sum(long? value)
Sum(long)
public static long Sum(long value)
Sum<TKey, TProps, TValue>(IRedbGrouping<TKey, TProps>, Expression<Func<TProps, TValue>>)
Sum in a group: Agg.Sum(g, x => x.Stock)
public static TValue Sum<TKey, TProps, TValue>(IRedbGrouping<TKey, TProps> group, Expression<Func<TProps, TValue>> selector) where TProps : class, new()