Remove deprecated packages

This commit is contained in:
2026-01-12 22:24:26 +01:00
parent 124ae942b5
commit dbdf5cfbe2
9 changed files with 4 additions and 874 deletions
@@ -1,31 +1,7 @@
using Newtonsoft.Json;
namespace System.Extensions;
namespace System.Extensions;
public static class ObjectExtensions
{
public static T? Deserialize<T>(this string serialized)
where T : class
{
if (serialized.IsNullOrWhiteSpace())
{
throw new ArgumentException("Provided serialized string cannot be null or whitespace", nameof(serialized));
}
return JsonConvert.DeserializeObject<T>(serialized);
}
public static string Serialize<T>(this T obj)
where T : class
{
if (obj is null)
{
throw new ArgumentNullException(nameof(obj));
}
return JsonConvert.SerializeObject(obj);
}
public static T Cast<T>(this object obj)
{
return (T)obj;
@@ -36,11 +12,6 @@ public static class ObjectExtensions
return obj as T;
}
public static Optional<T> ToOptional<T>(this T obj)
{
return Optional.FromValue(obj);
}
public static T ThrowIfNull<T>([ValidatedNotNull] this T? obj, string name) where T : class
{
if (obj is null)