```html System.Runtime.Serialization.NetDataContractAttribute - MSDN

System.Runtime.Serialization.NetDataContractAttribute

The NetDataContractAttribute class is used to specify how a type is serialized using the .NET Framework serialization technology.

Usage

You can use the NetDataContractAttribute class to mark classes, structs, and enumerations that you want to be serialized and deserialized using the DataContractSerializer.

Properties

Name Description
Name The name of the data contract.
Namespace The namespace of the data contract.
TypeDiscriminator Specifies the name of the type discriminator.

Example


    [DataContract]
    public class MyData
    {
        [DataMember(Name = "FirstName")]
        public string FirstName { get; set; }

        [DataMember(Name = "LastName")]
        public string LastName { get; set; }
    }
    
```