17 lines
471 B
C#
17 lines
471 B
C#
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));
|
|
}
|
|
}
|
|
} |