DataMemberAttribute.Name Propriedade

Definição

Obtém ou define um nome de membro de dados.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

Valor da propriedade

String

O nome do membro de dados.The name of the data member. O padrão é o nome do destino ao qual o atributo é aplicado.The default is the name of the target that the attribute is applied to.

Comentários

Essa propriedade é usada para substituir o nome padrão do membro de dados que é derivado do nome do membro anotado com o DataMemberAttribute .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.

A Name propriedade permite que você use nomes que não são permitidos como identificadores Common Language Runtime (CLR).The Name property enables you to use names that are not permitted as common language runtime (CLR) identifiers. Além disso, essa propriedade permite que o autor do tipo defina um nome de membro de dados separado do nome do membro do CLR.In addition, this property enables the type author to define a data member name separate from the CLR member name. Essa definição separada ajuda em cenários de controle de versão (alterando o nome do membro do CLR sem interromper o contrato de dados) e permite uma Convenção de nomenclatura diferente para membros de contato de dados e membros do CLR.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.

Aplica-se a