// called when loading the function
        // no input yet
        public Task <ITriggerBinding> TryCreateAsync(TriggerBindingProviderContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            ParameterInfo             parameter = context.Parameter;
            EventGridTriggerAttribute attribute = parameter.GetCustomAttribute <EventGridTriggerAttribute>(inherit: false);

            if (attribute == null)
            {
                return(Task.FromResult <ITriggerBinding>(null));
            }

            return(Task.FromResult <ITriggerBinding>(new EventGridTriggerBinding(context.Parameter, _extensionConfigProvider)));
        }
        // called when loading the function
        // no input yet
        public Task <ITriggerBinding> TryCreateAsync(TriggerBindingProviderContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            ParameterInfo             parameter = context.Parameter;
            EventGridTriggerAttribute attribute = parameter.GetCustomAttribute <EventGridTriggerAttribute>(inherit: false);

            if (attribute == null)
            {
                return(Task.FromResult <ITriggerBinding>(null));
            }

            if (!IsSupportedBindingType(parameter.ParameterType))
            {
                throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture,
                                                                  "Can't bind EventGridTriggerAttribute to type '{0}'.", parameter.ParameterType));
            }

            return(Task.FromResult <ITriggerBinding>(new EventGridTriggerBinding(context.Parameter, _extensionConfigProvider)));
        }