PdfRpt.Core.Helper.ApplyDataAnnotations.applyAggregateFunction C# (CSharp) Method

applyAggregateFunction() private static method

private static applyAggregateFunction ( PropertyInfo property, ColumnAttributes columnAttributes ) : void
property System.Reflection.PropertyInfo
columnAttributes PdfRpt.Core.Contracts.ColumnAttributes
return void
        private static void applyAggregateFunction(PropertyInfo property, ColumnAttributes columnAttributes)
        {
            var aggregateFunction = property.GetAggregateFunctionAttribute();
            if (aggregateFunction != null)
                columnAttributes.AggregateFunction = new AggregateProvider(aggregateFunction.Value);

            if (columnAttributes.AggregateFunction == null)
            {
                var customAggregateFunction = property.GetPdfRptColumnCustomAggregateFunctionAttribute();
                if (customAggregateFunction != null)
                    columnAttributes.AggregateFunction = Activator.CreateInstance(customAggregateFunction) as IAggregateFunction;
            }
        }