Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

DataMemberAttribute.Name Property

Definition

Namespace:
System.Runtime.Serialization
Assemblies:
System.Runtime.Serialization.dll, System.Runtime.Serialization.Primitives.dll
Assemblies:
netstandard.dll, System.Runtime.Serialization.Primitives.dll
Assembly:
System.Runtime.Serialization.Primitives.dll
Assembly:
System.Runtime.Serialization.dll
Assembly:
netstandard.dll
Source:
DataMemberAttribute.cs
Source:
DataMemberAttribute.cs
Source:
DataMemberAttribute.cs
Source:
DataMemberAttribute.cs
Source:
DataMemberAttribute.cs

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Gets or sets a data member name.

public:
 property System::String ^ Name { System::String ^ get(); void set(System::String ^ value); };
public string Name { get; set; }
public string? Name { get; set; }
member this.Name : string with get, set
Public Property Name As String

Property Value

The name of the data member. The default is the name of the target that the attribute is applied to.

Remarks

This property is used to override the default name of the data member that is derived from the name of the member annotated with the DataMemberAttribute.

The Name property enables you to use names that are not permitted as common language runtime (CLR) identifiers. In addition, this property enables the type author to define a data member name separate from the CLR member name. This separate definition helps in versioning scenarios (changing the CLR member name without breaking the data contract) and allows a different naming convention for data contact members and CLR members.

Applies to

See also


Feedback

Was this page helpful?