From d1e60609b0d843e432b319030a63f78f16e4d061 Mon Sep 17 00:00:00 2001 From: Adam Sitnik Date: Wed, 7 Aug 2024 17:18:13 +0200 Subject: [PATCH] Apply suggestions from code review --- .../migrate-to-datacontractserializer.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/standard/serialization/binaryformatter-migration-guide/migrate-to-datacontractserializer.md b/docs/standard/serialization/binaryformatter-migration-guide/migrate-to-datacontractserializer.md index eb018cc046247..6fbfab2141fe1 100644 --- a/docs/standard/serialization/binaryformatter-migration-guide/migrate-to-datacontractserializer.md +++ b/docs/standard/serialization/binaryformatter-migration-guide/migrate-to-datacontractserializer.md @@ -15,7 +15,7 @@ helpviewer_keywords: # Migrate to DataContractSerializer (XML) -The .NET base class libraries provide two XML serializers: [XmlSerializer](../introducing-xml-serialization.md) and [DataContractSerializer](../../../fundamentals/runtime-libraries/system-runtime-serialization-datacontractserializer.md). There are some subtle differences between these two, but for the purpose of the migration, this section focuses only on `DataContractSerializer`. Why? Because it **fully supports the serialization programming model that was used by `BinaryFormatter`**. All the types that are already marked as `[Serializable]` or implement `ISerializable` can be serialized with `DataContractSerializer`. Where is the catch? Known types must be specified up front (that's why it's secure). You need to know them and be able to get the `Type`, **even for private types**. +The .NET base class libraries provide two XML serializers: [XmlSerializer](../introducing-xml-serialization.md) and [DataContractSerializer](../../../fundamentals/runtime-libraries/system-runtime-serialization-datacontractserializer.md). There are some subtle differences between these two, but for the purpose of the migration, this section focuses only on `DataContractSerializer`. Why? Because it **fully supports the serialization programming model that was used by `BinaryFormatter`**. All the types that are already marked as `[Serializable]` or implement `ISerializable` can be serialized with `DataContractSerializer`. Where is the catch? Known types must be specified up front. You need to know them and be able to get the `Type`, **even for private types**. It's not required to specify most popular collections or primitive types like `string` or `DateTime` (the serializer has its own default allow-list), but there are exceptions like `DateTimeOffset`. For more information about the supported types, see [Types supported by the data contract serializer](../../../framework/wcf/feature-details/types-supported-by-the-data-contract-serializer.md).