CodeLiturgy.Dashboard/CodeLiturgy/Tools/JsonTools.cs

17 lines
472 B
C#
Raw Normal View History

2021-12-06 02:49:27 +03:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.Encodings.Web;
namespace PerformanceSolution.Tools
{
public static class JsonTools
{
2022-09-10 00:33:17 +03:00
public static Dictionary<string, object?> ConvertFromObjectToDictionary(object arg)
2021-12-06 02:49:27 +03:00
{
var properties = arg.GetType().GetProperties();
return properties.ToDictionary(property => property.Name, property => property.GetValue(arg));
}
}
}