private static CustomAttribute GetHierarchicalAttributeOrNull()

in src/Microsoft.NET.Sdk.Functions.Generator/TypeUtility.cs [48:63]


        private static CustomAttribute GetHierarchicalAttributeOrNull(Mono.Cecil.MethodDefinition method, Type type)
        {
            var attribute = method.GetCustomAttribute(type);
            if (attribute != null)
            {
                return attribute;
            }

            attribute = method.DeclaringType.GetCustomAttribute(type);
            if (attribute != null)
            {
                return attribute;
            }

            return null;
        }