public void Describe(DescribeGroupByContext describe) { var descriptor = describe.For(CategoryName, T("{Ticket properties"), T("Ticket properties")); List <AggregateMethods> methods = new List <AggregateMethods>(); methods.Add(AggregateMethods.Count); // Ticket Type descriptor.Element( type: GroupingByTicketType, name: T("Ticket Type"), description: T("group the result by {0} values", "Ticket Type"), run: (query, method) => RunTicketTypesGroupingQuery(query, method), aggregateMethods: methods, display: context => T("Ticket Type")); // Status descriptor.Element( type: GroupingByTicketStatus, name: T("Ticket Status"), description: T("group the result by {0} values", "Ticket states"), run: (query, method) => RunTicketStatusGroupingQuery(query, method), aggregateMethods: methods, display: context => T("Ticket Status")); // Priority descriptor.Element( type: GroupingByTicketPriority, name: T("Ticket Priority"), description: T("group the result by {0} values", "Ticket Priorities"), run: (query, method) => RunTicketPriorityGroupingQuery(query, method), aggregateMethods: methods, display: context => T("Ticket Priority")); }
public IEnumerable <TypeDescriptor <GroupByDescriptor> > DescribeGroupByFields() { DescribeGroupByContext context = new DescribeGroupByContext(); foreach (var provider in this.groupByProviders) { provider.Describe(context); } return(context.Describe()); }