public static Result max <Element, Result>(this IEnumerable <Element> items, IGetTheValueOfAProperty <Element, Result> accessor) where Result : IComparable <Result> { return(items.get_result_of_processing_all_with(new ReducingVisitor <Element, Result>(accessor, (a, b) => { return a.CompareTo(b) > 0 ? a : b; }))); }
public static ICompareTwoItems <Item> then_by <Item, Property>(this ICompareTwoItems <Item> previous_comparer, IGetTheValueOfAProperty <Item, Property> accessor, ICompareTwoItems <Property> order) where Property : IComparable <Property> { return((a, b) => { var previous_result = previous_comparer(a, b); return previous_result == 0 ? Sort <Item> .by(accessor, order)(a, b) : previous_result; }); }
public static IProcessAndReturnAValue <Element, Result> create_summing_visitor <Element, Result>( IGetTheValueOfAProperty <Element, Result> accessor) { return(new SummingVisitor <Element, Result>(accessor, (x, y) => { dynamic first = x; dynamic second = y; return first + second; })); }
public static Result avg <Element, Result>(this IEnumerable <Element> items, IGetTheValueOfAProperty <Element, Result> accessor) { return(items.get_result_of_processing_all_with( new AvgVisitor <Element, Result>(create_summing_visitor(accessor)))); }
public MatchingExtensionPoint(IGetTheValueOfAProperty <ItemToMatch, Property> accessor) { this.accessor = accessor; }
public SummingVisitor(IGetTheValueOfAProperty <Element, Result> accessor, Func <Result, Result, Result> accumulator) { this.accessor = accessor; this.accumulator = accumulator; }
public static MatchingExtensionPoint <ItemToMatch, Property> with_attribute <Property>( IGetTheValueOfAProperty <ItemToMatch, Property> get_the_value_of_a_property) { return(new MatchingExtensionPoint <ItemToMatch, Property>(get_the_value_of_a_property)); }
public ReducingVisitor(IGetTheValueOfAProperty <Element, Result> accessor, Func <Result, Result, Result> reducer) { this.reducer = reducer; this.accessor = accessor; first_result = true; }
public static ICompareTwoItems <Item> then_by_descending <Item, Property>(this ICompareTwoItems <Item> previous_comparer, IGetTheValueOfAProperty <Item, Property> accessor) where Property : IComparable <Property> { return(previous_comparer.then_by(accessor, SortOrders.descending)); }
public static ICompareTwoItems <Item> by <Property>(IGetTheValueOfAProperty <Item, Property> accessor) where Property : IComparable <Property> { return(by(accessor, SortOrders.@ascending)); }
public static ICompareTwoItems <Item> by <Property>(IGetTheValueOfAProperty <Item, Property> accessor, params Property[] sort_order) { return((a, b) => Array.IndexOf(sort_order, accessor(a)) - Array.IndexOf(sort_order, accessor(b))); }
public static ICompareTwoItems <Item> by <Property>(IGetTheValueOfAProperty <Item, Property> accessor, ICompareTwoItems <Property> order) where Property : IComparable <Property> { return((a, b) => order(accessor(a), accessor(b))); }
with_attribute <Property>(IGetTheValueOfAProperty <Item, Property> accessor) { return(new MatchCreationExtensionPoint <Item, Property>(accessor)); }
public MatchCreationExtensionPoint(IGetTheValueOfAProperty <Item, Property> accessor) { this.accessor = accessor; }
public EnumerableFilterExtensionPoint(IEnumerable <ItemToMatch> items_to_filter, IGetTheValueOfAProperty <ItemToMatch, PropertyType> accessor) { this.items_to_filter = items_to_filter; this.accessor = accessor; }
public static EnumerableFilterExtensionPoint <Item, ItemProperty> filter <Item, ItemProperty>( this IEnumerable <Item> enumerable, IGetTheValueOfAProperty <Item, ItemProperty> accessor) { return(new EnumerableFilterExtensionPoint <Item, ItemProperty>(enumerable, accessor)); }
public PropertyMatcher(IGetTheValueOfAProperty <Item, Property> get_the_value, Criteria <Property> property_criteria) { this.get_the_value = get_the_value; this.property_criteria = property_criteria; }
public MatchFactory(IGetTheValueOfAProperty <Item, Property> accessor) { this.accessor = accessor; }