DataContractAttribute.Namespace Property
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Gets or sets the namespace for the data contract for the type.
Assembly: System.Runtime.Serialization (in System.Runtime.Serialization.dll)
// Define the data contract. [DataContract(Name = "Customer", Namespace = "http://www.contoso.com", IsReference = true)] public class User { [DataMember(Name = "Last", EmitDefaultValue = true, IsRequired = true, Order = 2)] public string Name { get; set; } [DataMember(Order = 1)] public int Age { get; set; } public User() { } public User(string newName, int newAge) { Name = newName; Age = newAge; } }
Show: