In our application we have number of AggregatorTypes (idea copied from SQL Server)
i.e. MinAggregator MaxAggregator, CountAggregator, And SumAggregator.
Now I should check if Aggregator supports type of provided values. For Count it is not important. For Max and Min I use checking for IComparable.
But what to use for SUM?
I tried Converter but it also supports string.
Why there is no ISummable 🙂
Also IsNumeric like checking is not a solution for me. For example TimeSpan also can sum.
Here is sample IsSummable method
and IsAveragable function (what a weird name:) )
part of the code taken from MiscUtil by Marc Gravell