CustomAttributeNamedArgument Constructors

Definition

Initializes a new instance of the CustomAttributeNamedArgument class.

Overloads

CustomAttributeNamedArgument(MemberInfo, Object)

Initializes a new instance of the CustomAttributeNamedArgument class, which represents the specified field or property of the custom attribute, and specifies the value of the field or property.

CustomAttributeNamedArgument(MemberInfo, CustomAttributeTypedArgument)

Initializes a new instance of the CustomAttributeNamedArgument class, which represents the specified field or property of the custom attribute, and specifies a CustomAttributeTypedArgument object that describes the type and value of the field or property.

CustomAttributeNamedArgument(MemberInfo, Object)

Source:
CustomAttributeNamedArgument.cs
Source:
CustomAttributeNamedArgument.cs
Source:
CustomAttributeNamedArgument.cs

Initializes a new instance of the CustomAttributeNamedArgument class, which represents the specified field or property of the custom attribute, and specifies the value of the field or property.

C#
public CustomAttributeNamedArgument(System.Reflection.MemberInfo memberInfo, object? value);
C#
public CustomAttributeNamedArgument(System.Reflection.MemberInfo memberInfo, object value);

Parameters

memberInfo
MemberInfo

A field or property of the custom attribute. The new CustomAttributeNamedArgument object represents this member and its value.

value
Object

The value of the field or property of the custom attribute.

Exceptions

memberInfo is null.

memberInfo is not a field or property of the custom attribute.

Remarks

This constructor is for use by inheritors of the CustomAttributeNamedArgument class. It is not intended for use in application code.

Applies to

.NET 9 and other versions
Product Versions
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

CustomAttributeNamedArgument(MemberInfo, CustomAttributeTypedArgument)

Source:
CustomAttributeNamedArgument.cs
Source:
CustomAttributeNamedArgument.cs
Source:
CustomAttributeNamedArgument.cs

Initializes a new instance of the CustomAttributeNamedArgument class, which represents the specified field or property of the custom attribute, and specifies a CustomAttributeTypedArgument object that describes the type and value of the field or property.

C#
public CustomAttributeNamedArgument(System.Reflection.MemberInfo memberInfo, System.Reflection.CustomAttributeTypedArgument typedArgument);

Parameters

memberInfo
MemberInfo

A field or property of the custom attribute. The new CustomAttributeNamedArgument object represents this member and its value.

typedArgument
CustomAttributeTypedArgument

An object that describes the type and value of the field or property.

Exceptions

memberInfo is null.

Remarks

This constructor is for use by inheritors of the CustomAttributeNamedArgument class. It is not intended for use in application code.

Applies to

.NET 9 and other versions
Product Versions
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1