in src/BindingExtractor.cs [96:121]
public static List<BindingInformation> GetDefaultBindings(List<BindingInformation> existingInputBindings, List<BindingInformation> existingOutputBindings)
{
List<BindingInformation> defaultBindings = new List<BindingInformation>();
foreach (BindingInformation existingInputBinding in existingInputBindings)
{
// Try to figure out which IBinding class was used to create the BindingInformation
// Might be worth changing BindingInformation to refer to the instance of IBinding that created it
// Would need to avoid serializing this information when returning to the worker.
IEnumerable<IBinding> matchingSupportedBindings = supportedBindings.Where(x => x.BindingType == existingInputBinding.Type);
if (matchingSupportedBindings.Count() > 0)
{
foreach (IInputBinding matchingSupportedBinding in matchingSupportedBindings)
{
// Each IBinding is allowed to define its own list of default output bindings. It is also
// given the responsibility of determining whether these bindings should be used, based on
// the output bindings that have been explicitly declared
if (matchingSupportedBinding.ShouldUseDefaultOutputBindings(existingOutputBindings))
{
defaultBindings.AddRange(matchingSupportedBinding.defaultOutputBindings);
}
}
}
}
return defaultBindings;
}