in src/Microsoft.Azure.WebJobs.Host/Bindings/BindingProviders/TriggerAdapterBindingProvider.cs [56:89]
public Type GetDefaultType(Attribute attribute, FileAccess access, Type requestedType)
{
// If the requestedType is a batch type, we need to return the batch version of default types
IEnumerable<Type> targets = requestedType.IsArray && !_defaultTypes.Contains(requestedType)
? _defaultBatchTypes
: _defaultTypes;
if (requestedType == typeof(ParameterBindingData) || requestedType == typeof(ParameterBindingData[]))
{
if (_converterManager.HasConverter<TAttribute>(typeof(TTriggerValue), requestedType))
{
return requestedType;
}
// We should only be requesting ParameterBindingData if it is supported by the
// extension we're binding against. In theory, this should never happen.
throw new InvalidOperationException($"Converter for {requestedType} not found.");
}
foreach (var target in targets)
{
if (_converterManager.HasConverter<TAttribute>(typeof(TTriggerValue), target))
{
return target;
}
}
if (requestedType.IsArray)
{
return typeof(object[]);
}
return typeof(object);
}