public Task <IBinding> TryCreateAsync(BindingProviderContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

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

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

            IArgumentBinding <RedisEntity> argumentBinding = Provider.TryCreate(parameter);

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

            var account = RedisAccount.CreateDbFromConnectionString(_config.ConnectionString);

            IBinding binding = new RedisBinding(parameter.Name, argumentBinding, account, attribute, context, _trace);

            return(Task.FromResult(binding));
        }
        public Task <ITriggerBinding> TryCreateAsync(TriggerBindingProviderContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

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

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

            RedisAccount    account = RedisAccount.CreateDbFromConnectionString(_config.ConnectionString);
            ITriggerBinding binding = new RedisTriggerBinding(parameter, account, attribute.ChannelOrKey, attribute.Mode, _config, _trace);

            return(Task.FromResult(binding));
        }