-
Notifications
You must be signed in to change notification settings - Fork 1.4k
/
Copy pathIObjectSerializer.cs
31 lines (28 loc) · 1.33 KB
/
IObjectSerializer.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
namespace Microsoft.Toolkit.Uwp.Helpers
{
/// <summary>
/// A basic serialization service.
/// </summary>
[Obsolete("IObjectSerializer has been migrated to the Microsoft.Toolkit (CommunityToolkit.Common) package.")]
public interface IObjectSerializer
{
/// <summary>
/// Serialize an object into a string. It is recommended to use strings as the final format for objects if you plan to use the <see cref="BaseObjectStorageHelper.SaveFileAsync{T}(string, T)"/> method.
/// </summary>
/// <typeparam name="T">The type of the object to serialize.</typeparam>
/// <param name="value">The object to serialize.</param>
/// <returns>The serialized object.</returns>
object Serialize<T>(T value);
/// <summary>
/// Deserialize a primitive or string into an object of the given type.
/// </summary>
/// <typeparam name="T">The type of the deserialized object.</typeparam>
/// <param name="value">The string to deserialize.</param>
/// <returns>The deserialized object.</returns>
T Deserialize<T>(object value);
}
}