Further implementation of SeasonalEventService

This commit is contained in:
Chomp
2025-01-24 21:28:56 +00:00
parent 2ad2540b53
commit 902ed2a5de
3 changed files with 135 additions and 16 deletions
+2 -8
View File
@@ -67,17 +67,11 @@ namespace SptCommon.Extensions
public static Dictionary<string, object?> GetAllPropsAsDict(this object? obj)
{
var result = new Dictionary<string, object?>();
var props = obj.GetType().GetProperties();
foreach (var prop in props)
{
result.Add(prop.Name, prop.GetValue(obj));
}
return result;
return props.ToDictionary(prop => prop.Name, prop => prop.GetValue(obj));
}
public static T ToObject<T>(this JsonElement element)
{
var json = element.GetRawText();