Method GetMatchingCustomAttributes
- Namespace
- Xunit.Sdk
- Assembly
- xunit.v3.common.dll
GetMatchingCustomAttributes(Assembly, Type)
Gets all the custom attributes for the assembly that are of the given attribute type.
public static IReadOnlyCollection<Attribute> GetMatchingCustomAttributes(this Assembly assembly, Type attributeType)
Parameters
assemblyAssemblyThe assembly to get custom attributes for.
attributeTypeTypeThe type of the attribute to find. Will accept attribute types that are concrete, closed generic, and open generic. When provided an open generic type (e.g., MyAttribute<>) it will return matching closed generic attributes (e.g., MyAttribute>int<)
Returns
- IReadOnlyCollection<Attribute>
The matching attributes that decorate the assembly
GetMatchingCustomAttributes(Assembly, string)
Gets all the custom attributes for the assembly that are of the given attribute type.
public static IReadOnlyCollection<Attribute> GetMatchingCustomAttributes(this Assembly assembly, string assemblyQualifiedTypeName)
Parameters
assemblyAssemblyThe assembly to get custom attributes for.
assemblyQualifiedTypeNamestringThe type of the attribute to find. Will accept attribute types that are concrete, closed generic, and open generic. When provided an open generic type (e.g., MyAttribute<>) it will return matching closed generic attributes (e.g., MyAttribute>int<)
Returns
- IReadOnlyCollection<Attribute>
The matching attributes that decorate the assembly
GetMatchingCustomAttributes(Attribute, Type)
Gets all the custom attributes for the attribute that are of the given attribute type.
public static IReadOnlyCollection<Attribute> GetMatchingCustomAttributes(this Attribute attribute, Type attributeType)
Parameters
attributeAttributeThe attribute to get custom attributes for.
attributeTypeTypeThe type of the attribute to find. Will accept attribute types that are concrete, closed generic, and open generic. When provided an open generic type (e.g., MyAttribute<>) it will return matching closed generic attributes (e.g., MyAttribute>int<)
Returns
- IReadOnlyCollection<Attribute>
The matching attributes that decorate the attribute
GetMatchingCustomAttributes(Attribute, string)
Gets all the custom attributes for the attribute that are of the given attribute type.
public static IReadOnlyCollection<Attribute> GetMatchingCustomAttributes(this Attribute attribute, string assemblyQualifiedTypeName)
Parameters
attributeAttributeThe attribute to get custom attributes for.
assemblyQualifiedTypeNamestringThe type of the attribute to find. Will accept attribute types that are concrete, closed generic, and open generic. When provided an open generic type (e.g., MyAttribute<>) it will return matching closed generic attributes (e.g., MyAttribute>int<)
Returns
- IReadOnlyCollection<Attribute>
The matching attributes that decorate the attribute
GetMatchingCustomAttributes(MethodInfo, Type)
Gets all the custom attributes for the method that are of the given attribute type.
public static IReadOnlyCollection<Attribute> GetMatchingCustomAttributes(this MethodInfo method, Type attributeType)
Parameters
methodMethodInfoThe method to get custom attributes for.
attributeTypeTypeThe type of the attribute to find. Will accept attribute types that are concrete, closed generic, and open generic. When provided an open generic type (e.g., MyAttribute<>) it will return matching closed generic attributes (e.g., MyAttribute>int<)
Returns
- IReadOnlyCollection<Attribute>
The matching attributes that decorate the method
GetMatchingCustomAttributes(MethodInfo, string)
Gets all the custom attributes for the method that are of the given attribute type.
public static IReadOnlyCollection<Attribute> GetMatchingCustomAttributes(this MethodInfo method, string assemblyQualifiedTypeName)
Parameters
methodMethodInfoThe method to get custom attributes for.
assemblyQualifiedTypeNamestringThe type of the attribute to find. Will accept attribute types that are concrete, closed generic, and open generic. When provided an open generic type (e.g., MyAttribute<>) it will return matching closed generic attributes (e.g., MyAttribute>int<)
Returns
- IReadOnlyCollection<Attribute>
The matching attributes that decorate the method
GetMatchingCustomAttributes(ParameterInfo, Type)
Gets all the custom attributes for the parameter that are of the given attribute type.
public static IReadOnlyCollection<Attribute> GetMatchingCustomAttributes(this ParameterInfo parameter, Type attributeType)
Parameters
parameterParameterInfoThe parameter to get custom attributes for.
attributeTypeTypeThe type of the attribute to find. Will accept attribute types that are concrete, closed generic, and open generic. When provided an open generic type (e.g., MyAttribute<>) it will return matching closed generic attributes (e.g., MyAttribute>int<)
Returns
- IReadOnlyCollection<Attribute>
The matching attributes that decorate the parameter
GetMatchingCustomAttributes(ParameterInfo, string)
Gets all the custom attributes for the parameter that are of the given attribute type.
public static IReadOnlyCollection<Attribute> GetMatchingCustomAttributes(this ParameterInfo parameter, string assemblyQualifiedTypeName)
Parameters
parameterParameterInfoThe parameter to get custom attributes for.
assemblyQualifiedTypeNamestringThe type of the attribute to find. Will accept attribute types that are concrete, closed generic, and open generic. When provided an open generic type (e.g., MyAttribute<>) it will return matching closed generic attributes (e.g., MyAttribute>int<)
Returns
- IReadOnlyCollection<Attribute>
The matching attributes that decorate the parameter
GetMatchingCustomAttributes(Type, Type)
Gets all the custom attributes for the type that are of the given attribute type.
public static IReadOnlyCollection<Attribute> GetMatchingCustomAttributes(this Type type, Type attributeType)
Parameters
typeTypeThe type to get custom attributes for.
attributeTypeTypeThe type of the attribute to find. Will accept attribute types that are concrete, closed generic, and open generic. When provided an open generic type (e.g., MyAttribute<>) it will return matching closed generic attributes (e.g., MyAttribute>int<)
Returns
- IReadOnlyCollection<Attribute>
The matching attributes that decorate the type
GetMatchingCustomAttributes(Type, string)
Gets all the custom attributes for the type that are of the given attribute type.
public static IReadOnlyCollection<Attribute> GetMatchingCustomAttributes(this Type type, string assemblyQualifiedTypeName)
Parameters
typeTypeThe type to get custom attributes for.
assemblyQualifiedTypeNamestringThe type of the attribute to find. Will accept attribute types that are concrete, closed generic, and open generic. When provided an open generic type (e.g., MyAttribute<>) it will return matching closed generic attributes (e.g., MyAttribute>int<)
Returns
- IReadOnlyCollection<Attribute>
The matching attributes that decorate the type