31 instantiations of DataContractSerializer
Microsoft.AspNetCore.Authentication.Test (1)
WsFederation\CustomStateDataFormat.cs (1)
14private readonly DataContractSerializer serializer = new DataContractSerializer(typeof(AuthenticationProperties));
Microsoft.AspNetCore.Mvc.Formatters.Xml (2)
XmlDataContractSerializerInputFormatter.cs (1)
221return new DataContractSerializer(type, _serializerSettings);
XmlDataContractSerializerOutputFormatter.cs (1)
156return new DataContractSerializer(type, _serializerSettings);
Microsoft.AspNetCore.Mvc.Formatters.Xml.Test (9)
ProblemDetailsWrapperTest.cs (2)
25var serializer = new DataContractSerializer(typeof(ProblemDetailsWrapper)); 86var dataContractSerializer = new DataContractSerializer(wrapper.GetType());
SerializableErrorWrapperTests.cs (2)
63var serializer = new DataContractSerializer(typeof(SerializableErrorWrapper)); 116var dataContractSerializer = new DataContractSerializer(typeof(SerializableErrorWrapper));
ValidationProblemDetailsWrapperTest.cs (5)
29var serializer = new DataContractSerializer(typeof(ValidationProblemDetailsWrapper)); 85var serializer = new DataContractSerializer(typeof(ValidationProblemDetailsWrapper)); 123var serializer = new DataContractSerializer(typeof(ValidationProblemDetailsWrapper)); 175var dataContractSerializer = new DataContractSerializer(wrapper.GetType()); 213var dataContractSerializer = new DataContractSerializer(wrapper.GetType());
Microsoft.AspNetCore.Mvc.FunctionalTests (3)
ContentNegotiationTest.cs (1)
516var xmlDeserializer = new DataContractSerializer(typeof(Contact));
XmlDataContractSerializerInputFormatterTest.cs (2)
66var dcsSerializer = new DataContractSerializer(typeof(ModelBindingInfo)); 97var dcsSerializer = new DataContractSerializer(typeof(ModelBindingInfo));
Microsoft.Build.Tasks.Core (1)
AssemblyFolderCollection.cs (1)
30DataContractSerializer serializer = new DataContractSerializer(typeof(AssemblyFolderCollection));
Microsoft.Build.Utilities.Core (1)
AssemblyFolderCollection.cs (1)
30DataContractSerializer serializer = new DataContractSerializer(typeof(AssemblyFolderCollection));
Microsoft.VisualBasic.Forms (2)
Microsoft\VisualBasic\ApplicationServices\SingleInstanceHelpers.vb (2)
37Dim serializer As New DataContractSerializer(GetType(String())) 53Dim serializer As New DataContractSerializer(GetType(String()))
Microsoft.VisualBasic.Tests (1)
Microsoft\VisualBasic\ApplicationServices\SingleInstanceTests.cs (1)
272DataContractSerializer serializer = new(typeof(T));
System.Private.DataContractSerialization (4)
System\Runtime\Serialization\Json\JsonXmlDataContract.cs (2)
30DataContractSerializer dataContractSerializer = new DataContractSerializer(TraditionalDataContract.UnderlyingType, 52DataContractSerializer dataContractSerializer = new DataContractSerializer(Type.GetTypeFromHandle(declaredTypeHandle)!,
System\Runtime\Serialization\SchemaExporter.cs (1)
350DataContractSerializer serializer = new DataContractSerializer(Globals.TypeOfObject,
System\Runtime\Serialization\SchemaImporter.cs (1)
1338DataContractSerializer serializer = new DataContractSerializer(Globals.TypeOfObject, name, ns, knownTypes,
System.ServiceModel.Primitives.Tests (2)
ServiceModel\FaultExceptionTest.cs (2)
43var dcs = new DataContractSerializer(typeof(FaultException<FaultDetail>)); 63var dcs = new DataContractSerializer(typeof(FaultException));
System.ServiceModel.Syndication (5)
System\ServiceModel\Syndication\SyndicationElementExtension.cs (2)
70dataContractSerializer ??= new DataContractSerializer(dataContractExtension.GetType()); 123public TExtension GetObject<TExtension>() => GetObject<TExtension>(new DataContractSerializer(typeof(TExtension)));
System\ServiceModel\Syndication\SyndicationElementExtensionCollection.cs (2)
71dataContractSerializer ??= new DataContractSerializer(dataContractExtension.GetType()); 106return ReadElementExtensions<TExtension>(extensionName, extensionNamespace, new DataContractSerializer(typeof(TExtension)));
System\ServiceModel\Syndication\XmlSyndicationContent.cs (1)
103dataContractSerializer ??= new DataContractSerializer(typeof(TContent));
138 references to DataContractSerializer
Microsoft.AspNetCore.Authentication.Test (1)
WsFederation\CustomStateDataFormat.cs (1)
14private readonly DataContractSerializer serializer = new DataContractSerializer(typeof(AuthenticationProperties));
Microsoft.AspNetCore.Mvc.Formatters.Xml (21)
DelegatingEnumerable.cs (1)
25/// This constructor is necessary for <see cref="System.Runtime.Serialization.DataContractSerializer"/>
XmlDataContractSerializerInputFormatter.cs (9)
16/// to strongly-typed objects using <see cref="DataContractSerializer"/>. 72/// <see cref="DataContractSerializer"/>. 144var serializer = GetCachedSerializer(type); 210/// Called during deserialization to get the <see cref="DataContractSerializer"/>. 213/// <returns>The <see cref="DataContractSerializer"/> used during deserialization.</returns> 214protected virtual DataContractSerializer? CreateSerializer(Type type) 234/// <returns>The <see cref="DataContractSerializer"/> instance.</returns> 235protected virtual DataContractSerializer GetCachedSerializer(Type type) 248return (DataContractSerializer)serializer!;
XmlDataContractSerializerOutputFormatter.cs (11)
21/// to XML using <see cref="DataContractSerializer"/> 53/// <param name="writerSettings">The settings to be used by the <see cref="DataContractSerializer"/>.</param> 62/// <param name="writerSettings">The settings to be used by the <see cref="DataContractSerializer"/>.</param> 101/// <see cref="DataContractSerializer"/>. 142/// Create a new instance of <see cref="DataContractSerializer"/> for the given object type. 145/// <returns>A new instance of <see cref="DataContractSerializer"/></returns> 146protected virtual DataContractSerializer? CreateSerializer(Type type) 256var dataContractSerializer = GetCachedSerializer(wrappingType!); 292/// <returns>The <see cref="DataContractSerializer"/> instance.</returns> 293protected virtual DataContractSerializer GetCachedSerializer(Type type) 304return (DataContractSerializer)serializer!;
Microsoft.AspNetCore.Mvc.Formatters.Xml.Test (11)
ProblemDetailsWrapperTest.cs (2)
25var serializer = new DataContractSerializer(typeof(ProblemDetailsWrapper)); 86var dataContractSerializer = new DataContractSerializer(wrapper.GetType());
SerializableErrorWrapperTests.cs (2)
63var serializer = new DataContractSerializer(typeof(SerializableErrorWrapper)); 116var dataContractSerializer = new DataContractSerializer(typeof(SerializableErrorWrapper));
ValidationProblemDetailsWrapperTest.cs (5)
29var serializer = new DataContractSerializer(typeof(ValidationProblemDetailsWrapper)); 85var serializer = new DataContractSerializer(typeof(ValidationProblemDetailsWrapper)); 123var serializer = new DataContractSerializer(typeof(ValidationProblemDetailsWrapper)); 175var dataContractSerializer = new DataContractSerializer(wrapper.GetType()); 213var dataContractSerializer = new DataContractSerializer(wrapper.GetType());
XmlDataContractSerializerInputFormatterTest.cs (1)
762protected override DataContractSerializer CreateSerializer(Type type)
XmlDataContractSerializerOutputFormatterTest.cs (1)
817protected override DataContractSerializer CreateSerializer(Type type)
Microsoft.AspNetCore.Mvc.FunctionalTests (3)
ContentNegotiationTest.cs (1)
516var xmlDeserializer = new DataContractSerializer(typeof(Contact));
XmlDataContractSerializerInputFormatterTest.cs (2)
66var dcsSerializer = new DataContractSerializer(typeof(ModelBindingInfo)); 97var dcsSerializer = new DataContractSerializer(typeof(ModelBindingInfo));
Microsoft.Build.Tasks.Core (1)
AssemblyFolderCollection.cs (1)
30DataContractSerializer serializer = new DataContractSerializer(typeof(AssemblyFolderCollection));
Microsoft.Build.Utilities.Core (1)
AssemblyFolderCollection.cs (1)
30DataContractSerializer serializer = new DataContractSerializer(typeof(AssemblyFolderCollection));
Microsoft.VisualBasic.Tests (1)
Microsoft\VisualBasic\ApplicationServices\SingleInstanceTests.cs (1)
272DataContractSerializer serializer = new(typeof(T));
netstandard (1)
netstandard.cs (1)
1751[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.Serialization.DataContractSerializer))]
System.Private.DataContractSerialization (88)
System\Runtime\Serialization\DataContractSerializerExtensions.cs (2)
8public static ISerializationSurrogateProvider? GetSerializationSurrogateProvider(this DataContractSerializer serializer) 13public static void SetSerializationSurrogateProvider(this DataContractSerializer serializer, ISerializationSurrogateProvider? provider)
System\Runtime\Serialization\ExportOptions.cs (1)
14/// The <see cref="KnownTypes"/> property is used by the <see cref="DataContractSerializer"/> to include types that can be read in an object graph.
System\Runtime\Serialization\Json\DataContractJsonSerializer.cs (2)
502graph = DataContractSerializer.SurrogateToDataContractType(_serializationSurrogateProvider, graph, declaredType, ref graphType); 644DataContract contract = DataContractSerializer.GetDataContract(declaredTypeContract, declaredType, objectType);
System\Runtime\Serialization\Json\JsonClassDataContract.cs (2)
39if (DataContractSerializer.Option == SerializationOption.ReflectionOnly) 70if (DataContractSerializer.Option == SerializationOption.ReflectionOnly)
System\Runtime\Serialization\Json\JsonCollectionDataContract.cs (3)
39if (DataContractSerializer.Option == SerializationOption.ReflectionOnly) 76if (DataContractSerializer.Option == SerializationOption.ReflectionOnly) 107if (DataContractSerializer.Option == SerializationOption.ReflectionOnly)
System\Runtime\Serialization\Json\JsonEncodingStreamWrapper.cs (9)
151new ArraySegment<byte>(DataContractSerializer.ValidatingUTF8.GetBytes(GetEncoding(dataEnc).GetChars(buffer, offset, count))); 288SupportedEncoding.UTF8 => DataContractSerializer.ValidatingUTF8, 289SupportedEncoding.UTF16LE => DataContractSerializer.ValidatingUTF16, 290SupportedEncoding.UTF16BE => DataContractSerializer.ValidatingBEUTF16, 309if (encoding.WebName == DataContractSerializer.ValidatingUTF8.WebName) 313else if (encoding.WebName == DataContractSerializer.ValidatingUTF16.WebName) 317else if (encoding.WebName == DataContractSerializer.ValidatingBEUTF16.WebName) 453_byteCount = DataContractSerializer.ValidatingUTF8.GetBytes(_chars, 0, count, _bytes, 0); 473_dec = DataContractSerializer.ValidatingUTF8.GetDecoder();
System\Runtime\Serialization\Json\JsonXmlDataContract.cs (2)
30DataContractSerializer dataContractSerializer = new DataContractSerializer(TraditionalDataContract.UnderlyingType, 52DataContractSerializer dataContractSerializer = new DataContractSerializer(Type.GetTypeFromHandle(declaredTypeHandle)!,
System\Runtime\Serialization\Json\XmlJsonWriter.cs (1)
385WriteEscapedJsonString(DataContractSerializer.BinHexEncoding.GetString(buffer, index, count));
System\Runtime\Serialization\SchemaExporter.cs (1)
350DataContractSerializer serializer = new DataContractSerializer(Globals.TypeOfObject,
System\Runtime\Serialization\SchemaImporter.cs (1)
1338DataContractSerializer serializer = new DataContractSerializer(Globals.TypeOfObject, name, ns, knownTypes,
System\Runtime\Serialization\XmlDataContract.cs (2)
98if (DataContractSerializer.Option == SerializationOption.CodeGenOnly || DataContractSerializer.Option == SerializationOption.ReflectionAsBackup)
System\Runtime\Serialization\XmlFormatReaderGenerator.cs (3)
82if (DataContractSerializer.Option == SerializationOption.ReflectionOnly) 174if (DataContractSerializer.Option == SerializationOption.ReflectionOnly) 199if (DataContractSerializer.Option == SerializationOption.ReflectionOnly)
System\Runtime\Serialization\XmlFormatWriterGenerator.cs (2)
76if (DataContractSerializer.Option == SerializationOption.ReflectionOnly) 120if (DataContractSerializer.Option == SerializationOption.ReflectionOnly)
System\Runtime\Serialization\XmlObjectSerializerContext.cs (1)
48internal XmlObjectSerializerContext(DataContractSerializer serializer, DataContract rootTypeDataContract, DataContractResolver? dataContractResolver)
System\Runtime\Serialization\XmlObjectSerializerReadContext.cs (2)
69internal static XmlObjectSerializerReadContext CreateContext(DataContractSerializer serializer, DataContract rootTypeDataContract, DataContractResolver? dataContractResolver) 81internal XmlObjectSerializerReadContext(DataContractSerializer serializer, DataContract rootTypeDataContract, DataContractResolver? dataContractResolver)
System\Runtime\Serialization\XmlObjectSerializerReadContextComplex.cs (2)
17internal XmlObjectSerializerReadContextComplex(DataContractSerializer serializer, DataContract rootTypeDataContract, DataContractResolver? dataContractResolver) 108Type surrogateType = DataContractSerializer.GetSurrogatedType(_serializationSurrogateProvider, type);
System\Runtime\Serialization\XmlObjectSerializerWriteContext.cs (2)
34internal static XmlObjectSerializerWriteContext CreateContext(DataContractSerializer serializer, DataContract rootTypeDataContract, DataContractResolver? dataContractResolver) 41protected XmlObjectSerializerWriteContext(DataContractSerializer serializer, DataContract rootTypeDataContract, DataContractResolver? resolver)
System\Runtime\Serialization\XmlObjectSerializerWriteContextComplex.cs (3)
24internal XmlObjectSerializerWriteContextComplex(DataContractSerializer serializer, DataContract rootTypeDataContract, DataContractResolver? dataContractResolver) 206Type surrogateType = DataContractSerializer.GetSurrogatedType(_serializationSurrogateProvider, type); 231obj = DataContractSerializer.SurrogateToDataContractType(_serializationSurrogateProvider!, obj, declaredType, ref objType);
System\Xml\EncodingStreamWrapper.cs (18)
94_byteCount = DataContractSerializer.ValidatingUTF8.GetBytes(_chars, 0, count, _bytes, 0); 126SupportedEncoding.UTF8 => DataContractSerializer.ValidatingUTF8, 127SupportedEncoding.UTF16LE => DataContractSerializer.ValidatingUTF16, 128SupportedEncoding.UTF16BE => DataContractSerializer.ValidatingBEUTF16, 135SupportedEncoding.UTF8 => DataContractSerializer.UTF8NoBom, 136SupportedEncoding.UTF16LE => DataContractSerializer.UTF16NoBom, 137SupportedEncoding.UTF16BE => DataContractSerializer.BEUTF16NoBom, 154else if (encoding.WebName == DataContractSerializer.ValidatingUTF8.WebName) 156else if (encoding.WebName == DataContractSerializer.ValidatingUTF16.WebName) 158else if (encoding.WebName == DataContractSerializer.ValidatingBEUTF16.WebName) 177_dec = DataContractSerializer.ValidatingUTF8.GetDecoder(); 403ThrowEncodingMismatch(DataContractSerializer.UTF8NoBom.GetString(buffer, encStart, encCount), DataContractSerializer.UTF8NoBom.GetString(s_encodingUTF8, 0, s_encodingUTF8.Length)); 407ThrowEncodingMismatch(DataContractSerializer.UTF8NoBom.GetString(buffer, encStart, encCount), e); 411ThrowEncodingMismatch(DataContractSerializer.UTF8NoBom.GetString(buffer, encStart, encCount), e); 473bytes = new byte[DataContractSerializer.ValidatingUTF8.GetMaxByteCount(ccount)]; 474int bcount = DataContractSerializer.ValidatingUTF8.GetBytes(chars, 0, ccount, bytes, 0); 488seg = new ArraySegment<byte>(DataContractSerializer.ValidatingUTF8.GetBytes(GetEncoding(declEnc).GetChars(buffer, offset, count)));
System\Xml\ValueHandle.cs (5)
443int actualLength = DataContractSerializer.Base64Encoding.GetBytes(_bufferReader.Buffer, _offset, _length, buffer, 0); 459return DataContractSerializer.Base64Encoding.GetBytes(XmlConverter.StripWhitespace(GetString())); 512return DataContractSerializer.Base64Encoding.GetString(bytes, 0, bytes.Length); 674actual = DataContractSerializer.Base64Encoding.GetBytes(_bufferReader.Buffer, _offset, charCount, buffer, offset); 708var encoding = DataContractSerializer.ValidatingUTF8;
System\Xml\XmlBaseReader.cs (3)
1178return ReadBytes(DataContractSerializer.Base64Encoding, 3, 4, buffer, offset, Math.Min(count, 512), false); 1370return ReadBytes(DataContractSerializer.Base64Encoding, 3, 4, buffer, offset, Math.Min(count, 512), true); 1390return ReadBytes(DataContractSerializer.BinHexEncoding, 1, 2, buffer, offset, Math.Min(count, 512), true);
System\Xml\XmlBaseWriter.cs (7)
1455WriteRaw(DataContractSerializer.BinHexEncoding.GetString(buffer, offset, count)); 1485WriteAttributeText(DataContractSerializer.Base64Encoding.GetString(_trailBytes, 0, _trailByteCount)); 1486WriteAttributeText(DataContractSerializer.Base64Encoding.GetString(buffer, offset, actualByteCount - _trailByteCount)); 1544WriteAttributeText(DataContractSerializer.Base64Encoding.GetString(_trailBytes, 0, _trailByteCount)); 1545WriteAttributeText(DataContractSerializer.Base64Encoding.GetString(buffer, offset, actualByteCount - _trailByteCount)); 1748WriteAttributeText(DataContractSerializer.Base64Encoding.GetString(_trailBytes, 0, _trailByteCount)); 1764WriteAttributeText(DataContractSerializer.Base64Encoding.GetString(_trailBytes, 0, _trailByteCount));
System\Xml\XmlBinaryWriter.cs (3)
1067_captureText = DataContractSerializer.Base64Encoding.GetString(arraySegment.Array!, arraySegment.Offset, arraySegment.Count); 1105WriteText(DataContractSerializer.Base64Encoding.GetString(trailBytes!, 0, trailByteCount)); 1107WriteText(DataContractSerializer.Base64Encoding.GetString(buffer, offset, count));
System\Xml\XmlConverter.cs (4)
339return DataContractSerializer.ValidatingUTF8.GetString(buffer, offset, count); 351return DataContractSerializer.ValidatingUTF16.GetString(buffer, offset, count); 364return DataContractSerializer.ValidatingUTF8.GetBytes(value); 376return DataContractSerializer.ValidatingUTF8.GetChars(buffer, offset, count, chars, charOffset);
System\Xml\XmlDictionaryWriter.cs (1)
44return CreateTextWriter(stream, DataContractSerializer.UTF8NoBom, true);
System\Xml\XmlSigningNodeWriter.cs (1)
357Base64Encoding encoding = DataContractSerializer.Base64Encoding;
System\Xml\XmlStreamNodeWriter.cs (3)
355return (_encoding ?? DataContractSerializer.ValidatingUTF8).GetByteCount(chars, charCount); 384return (int)(bytes - _bytes) + (_encoding ?? DataContractSerializer.ValidatingUTF8).GetBytes(chars, (int)(charsMax - chars), bytes, (int)(bytesMax - bytes)); 388return (_encoding ?? DataContractSerializer.ValidatingUTF8).GetBytes(chars, charCount, _bytes, buffer.Length - offset);
System\Xml\XmlUTF8TextWriter.cs (2)
651Base64Encoding encoding = DataContractSerializer.Base64Encoding; 670Base64Encoding encoding = DataContractSerializer.Base64Encoding;
System.Runtime.Serialization (1)
System.Runtime.Serialization.cs (1)
8[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.Serialization.DataContractSerializer))]
System.Runtime.Serialization.Xml (1)
artifacts\obj\System.Runtime.Serialization.Xml\Debug\net10.0\System.Runtime.Serialization.Xml.Forwards.cs (1)
8[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.Serialization.DataContractSerializer))]
System.ServiceModel.Primitives.Tests (4)
Description\OperationBehaviorTest.cs (2)
101DataContractSerializer dcs = (DataContractSerializer)behavior.CreateSerializer(typeof(SurrogateTestType), nameof(SurrogateTestType), "ns", new List<Type>());
ServiceModel\FaultExceptionTest.cs (2)
43var dcs = new DataContractSerializer(typeof(FaultException<FaultDetail>)); 63var dcs = new DataContractSerializer(typeof(FaultException));
System.ServiceModel.Syndication (4)
System\ServiceModel\Syndication\SyndicationContent.cs (1)
50return new XmlSyndicationContent(Atom10Constants.XmlMediaType, dataContractObject, (DataContractSerializer)null);
System\ServiceModel\Syndication\SyndicationElementExtensionCollection.cs (2)
50Add(extension, (DataContractSerializer)null); 59public void Add(object dataContractExtension, DataContractSerializer serializer)
System\ServiceModel\Syndication\XmlSyndicationContent.cs (1)
99public TContent ReadContent<TContent>() => ReadContent<TContent>((DataContractSerializer)null);