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)); }
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)); }