diff --git a/sdk/core/Azure.Core/samples/Serialization.md b/sdk/core/Azure.Core/samples/Serialization.md new file mode 100644 index 000000000000..d1b13ef92649 --- /dev/null +++ b/sdk/core/Azure.Core/samples/Serialization.md @@ -0,0 +1,71 @@ +# Azure.Core public serialization samples + +## Using IJsonSerialization Try methods + +Serialization + +```C# Snippet:Try_Serialize +//TODO +``` + +Deserialization + +```C# Snippet:Try_Deserialize +//TODO +``` + +## Using IJsonSerialization Non-Try methods + +Serialization + +```C# Snippet:NonTry_Serialize +//TODO +``` + +Deserialization + +```C# Snippet:NonTry_Deserialize +//TODO +``` + +## Using explicit cast + +Serialization + +```C# Snippet:ExplicitCast_Serialize +//TODO +``` + +Deserialization + +```C# Snippet:ExplicitCast_Deserialize +//TODO +``` + +## Using System.Text.Json + +Serialization + +```C# Snippet:Stj_Serialize +//TODO +``` + +Deserialization + +```C# Snippet:Stj_Deserialize +//TODO +``` + +## Using static deserializer + +Serialization + +```C# Snippet:Static_Serialize +//TODO +``` + +Deserialization + +```C# Snippet:Static_Deserialize +//TODO +``` diff --git a/sdk/core/Azure.Core/tests/samples/SerializationSamples.cs b/sdk/core/Azure.Core/tests/samples/SerializationSamples.cs new file mode 100644 index 000000000000..ed876b391499 --- /dev/null +++ b/sdk/core/Azure.Core/tests/samples/SerializationSamples.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using Azure.Identity; +using Azure.Security.KeyVault.Secrets; +using NUnit.Framework; + +namespace Azure.Core.Samples +{ + public class SerializationSamples + { + [Test] + [Ignore("Only verifying that the sample builds")] + public void TrySerialize() + { + #region Snippet:Try_Serialize + //TODO + #endregion + } + + [Test] + [Ignore("Only verifying that the sample builds")] + public void TryDeserialize() + { + #region Snippet:Try_Deserialize + //TODO + #endregion + } + + [Test] + [Ignore("Only verifying that the sample builds")] + public void NonTrySerialize() + { + #region Snippet:NonTry_Serialize + //TODO + #endregion + } + + [Test] + [Ignore("Only verifying that the sample builds")] + public void NonTryDeserialize() + { + #region Snippet:NonTry_Deserialize + //TODO + #endregion + } + + [Test] + [Ignore("Only verifying that the sample builds")] + public void ExplicitCastSerialize() + { + #region Snippet:ExplicitCast_Serialize + //TODO + #endregion + } + + [Test] + [Ignore("Only verifying that the sample builds")] + public void ExplicitCastDeserialize() + { + #region Snippet:ExplicitCast_Deserialize + //TODO + #endregion + } + + [Test] + [Ignore("Only verifying that the sample builds")] + public void StjSerialize() + { + #region Snippet:Stj_Serialize + //TODO + #endregion + } + + [Test] + [Ignore("Only verifying that the sample builds")] + public void StjDeserialize() + { + #region Snippet:Stj_Deserialize + //TODO + #endregion + } + + [Test] + [Ignore("Only verifying that the sample builds")] + public void StaticSerialize() + { + #region Snippet:Static_Serialize + //TODO + #endregion + } + + [Test] + [Ignore("Only verifying that the sample builds")] + public void StaticDeserialize() + { + #region Snippet:Static_Deserialize + //TODO + #endregion + } + } +}