コード例 #1
0
            public async Task <ITriggerData> BindAsync(Message value, ValueBindingContext context)
            {
                Message clone     = value.Clone();
                object  converted = await _converter.ConvertAsync(value, context.CancellationToken);

                IValueProvider provider = await MessageValueProvider.CreateAsync(clone, converted, typeof(T),
                                                                                 context.CancellationToken);

                return(new TriggerData(provider, null));
            }
コード例 #2
0
            public async Task <ITriggerData> BindAsync(Message value, ValueBindingContext context)
            {
                IValueProvider provider;
                Message        clone = value.Clone();

                TInput contents = GetBody(value, context);

                if (contents == null)
                {
                    provider = await MessageValueProvider.CreateAsync(clone, null, ValueType,
                                                                      context.CancellationToken);

                    return(new TriggerData(provider, null));
                }

                provider = await MessageValueProvider.CreateAsync(clone, contents, ValueType,
                                                                  context.CancellationToken);

                IReadOnlyDictionary <string, object> bindingData = (_bindingDataProvider != null)
                    ? _bindingDataProvider.GetBindingData(contents) : null;

                return(new TriggerData(provider, bindingData));
            }