CodeLiturgy.Dashboard/BlueWest/Tools/JsonTools.cs

17 lines
471 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
{
public static Dictionary<string, object> ConvertFromObjectToDictionary(object arg)
{
var properties = arg.GetType().GetProperties();
return properties.ToDictionary(property => property.Name, property => property.GetValue(arg));
}
}
}