<PackageReference Include="System.Runtime.Serialization.Primitives" Version="4.0.11-beta-23409" />

DataContractAttribute

public sealed class DataContractAttribute : Attribute
Specifies that the type defines or implements a data contract and is serializable by a serializer, such as the DataContractSerializer. To make their type serializable, type authors must define a data contract for their type.
public bool IsNameSetExplicitly { get; }

public bool IsNamespaceSetExplicitly { get; }

public bool IsReference { get; set; }

Gets or sets a value that indicates whether to preserve object reference data.

public bool IsReferenceSetExplicitly { get; }

public string Name { get; set; }

Gets or sets the name of the data contract for the type.

public string Namespace { get; set; }

Gets or sets the namespace for the data contract for the type.

Initializes a new instance of the DataContractAttribute class.