Ejemplo n.º 1
0
        static IEnumerable <_IAttributeInfo> GetCustomAttributes(
            MethodInfo method,
            string assemblyQualifiedAttributeTypeName)
        {
            Guard.ArgumentNotNull(nameof(method), method);
            Guard.ArgumentNotNull(nameof(assemblyQualifiedAttributeTypeName), assemblyQualifiedAttributeTypeName);

            var attributeType = ReflectionAttributeNameCache.GetType(assemblyQualifiedAttributeTypeName);

            Guard.ArgumentValidNotNull(nameof(assemblyQualifiedAttributeTypeName), $"Could not load type: '{assemblyQualifiedAttributeTypeName}'", attributeType);

            return(GetCustomAttributes(method, attributeType, ReflectionAttributeInfo.GetAttributeUsage(attributeType)));
        }
Ejemplo n.º 2
0
        static IEnumerable <IAttributeInfo> GetCustomAttributes(MethodInfo method, string assemblyQualifiedAttributeTypeName)
        {
            var attributeType = ReflectionAttributeNameCache.GetType(assemblyQualifiedAttributeTypeName);

            return(GetCustomAttributes(method, attributeType, ReflectionAttributeInfo.GetAttributeUsage(attributeType)));
        }