in src/Microsoft.NET.Sdk.Functions.Generator/MethodInfoExtensions.cs [61:84]
public static FunctionJsonSchema ToFunctionJson(this MethodDefinition method, string assemblyPath)
{
// For every SDK parameter, convert it to a FunctionJson bindings.
// Every parameter can potentially contain more than 1 attribute that will be converted into a binding object.
var bindingsFromParameters = method.HasNoAutomaticTriggerAttribute() ? new[] { method.ManualTriggerBinding() } : method.Parameters
.Select(p => p.ToFunctionJsonBindings())
.SelectMany(i => i);
// Get binding if a return attribute is used.
// Ex: [return: Queue("myqueue-items-a", Connection = "MyStorageConnStr")]
var returnBindings = GetOutputBindingsFromReturnAttribute(method);
var allBindings = bindingsFromParameters.Concat(returnBindings).ToArray();
return new FunctionJsonSchema
{
Bindings = allBindings,
// Entry point is the fully qualified name of the function
EntryPoint = $"{method.DeclaringType.FullName}.{method.Name}",
ScriptFile = assemblyPath,
// A method is disabled is any of it's parameters have [Disabled] attribute
// or if the method itself or class have the [Disabled] attribute.
Disabled = method.GetDisabled()
};
}