in src/Microsoft.NET.Sdk.Functions.Generator/MethodInfoExtensions.cs [146:176]
public static object GetDisabled(this MethodDefinition method)
{
var customAttribute = method.Parameters.Select(p => p.GetDisabledAttribute()).Where(a => a != null).FirstOrDefault() ??
method.GetDisabledAttribute() ??
method.DeclaringType.GetDisabledAttribute();
if (customAttribute != null)
{
var attribute = customAttribute.ToReflection();
// With a SettingName defined, just put that as string. The ScriptHost will evaluate it.
var settingName = attribute.GetValue<string>("SettingName");
if (!string.IsNullOrEmpty(settingName))
{
return settingName;
}
var providerType = attribute.GetValue<Type>("ProviderType");
if (providerType != null)
{
return providerType;
}
// With neither settingName or providerType, no arguments were given and it should always be true
return true;
}
// No attribute means not disabled
return false;
}