public async Task <ITriggerData> BindAsync(BrokeredMessage value, ValueBindingContext context) { BrokeredMessage clone = value.Clone(); object converted = await _converter.ConvertAsync(value, context.CancellationToken); IValueProvider provider = await BrokeredMessageValueProvider.CreateAsync(clone, converted, typeof(T), context.CancellationToken); return(new TriggerData(provider, null)); }
public async Task <ITriggerData> BindAsync(BrokeredMessage value, ValueBindingContext context) { IValueProvider provider; BrokeredMessage clone = value.Clone(); TInput contents = await GetBody(value, context); if (contents == null) { provider = await BrokeredMessageValueProvider.CreateAsync(clone, null, ValueType, context.CancellationToken); return(new TriggerData(provider, null)); } provider = await BrokeredMessageValueProvider.CreateAsync(clone, contents, ValueType, context.CancellationToken); IReadOnlyDictionary <string, object> bindingData = (_bindingDataProvider != null) ? _bindingDataProvider.GetBindingData(contents) : null; return(new TriggerData(provider, bindingData)); }