public void RegisterResolver(IRoutineResolver resolver)
        {
            if (resolver == null)
                return;

            var type = resolver.GetType();
            if (type.IsAbstract || type.IsInterface)
                throw new ArgumentException();

            if (!resolvers.ContainsKey(type))
                resolvers[type] = resolver;
        }
        /// <summary>
        /// Checks if a function matched against the given request represents
        /// an aggregate function.
        /// </summary>
        /// <param name="resolver">The routine resolver.</param>
        /// <param name="request">The invocation request used to resolve the function.</param>
        /// <param name="query">The parent query context.</param>
        /// <returns>
        /// Returns <c>true</c> if a routine was resolved for the given request,
        /// this is a <see cref="IFunction"/> and the <see cref="FunctionType"/> is
        /// <see cref="FunctionType.Aggregate"/>, otherwise <c>false</c>.
        /// </returns>
        public static bool IsAggregateFunction(this IRoutineResolver resolver, Invoke request, IQuery query)
        {
            var routine = resolver.ResolveRoutine(request, query);

            var function = routine as IFunction;

            if (function == null)
            {
                return(false);
            }

            return(function.FunctionType == FunctionType.Aggregate);
        }