DocSpace-client/thirdparty/Microsoft.Graph.Core/Serialization/ISerializer.cs
2020-07-10 18:37:02 +03:00

38 lines
1.5 KiB
C#

// ------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
// ------------------------------------------------------------------------------
namespace Microsoft.Graph
{
using System.IO;
/// <summary>
/// An interface for serializing and deserializing JSON objects.
/// </summary>
public interface ISerializer
{
/// <summary>
/// Deserializes the stream to an object of the specified type.
/// </summary>
/// <typeparam name="T">The deserialization type.</typeparam>
/// <param name="stream">The stream to deserialize.</param>
/// <returns>The deserialized object.</returns>
T DeserializeObject<T>(Stream stream);
/// <summary>
/// Deserializes the JSON string to an object of the specified type.
/// </summary>
/// <typeparam name="T">The deserialization type.</typeparam>
/// <param name="inputString">The JSON string to deserialize.</param>
/// <returns>The deserialized object.</returns>
T DeserializeObject<T>(string inputString);
/// <summary>
/// Serializes the specified object into a JSON string.
/// </summary>
/// <param name="serializeableObject">The object to serialize.</param>
/// <returns>The JSON string.</returns>
string SerializeObject(object serializeableObject);
}
}