-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Description
Describe the bug
We're only using this dependency (which is large) for a single helper in the package. We should streamline this with some docs instead of having a hard dependency. This also makes it easier for folks to use either Newtonsoft.Json or System.Text.Json depending on what their app is already using.
Add docs for:
using System.Text.Json;
namespace Microsoft.Toolkit.Uwp.Helpers
{
public class JsonObjectSerializer : IObjectSerializer
{
public string Serialize<T>(T value) => JsonSerializer.Serialize(value);
public T Deserialize<T>(string value) => JsonSerializer.Deserialize<T>(value);
}
}using Newtonsoft.Json;
namespace Microsoft.Toolkit.Uwp.Helpers
{
internal class JsonObjectSerializer : IObjectSerializer
{
public string Serialize<T>(T value) => JsonConvert.SerializeObject(value);
public T Deserialize<T>(string value) => JsonConvert.DeserializeObject<T>(value);
}
}Instead of including explicitly. This will help with #3145 as most other higher-level toolkit libs are including the UI package which also includes this package.