.NET Format Style Fixes
This commit is contained in:
@@ -6,7 +6,8 @@ namespace SPTarkov.Common.Extensions;
|
||||
|
||||
public static class ObjectExtensions
|
||||
{
|
||||
private static readonly Dictionary<Type, Dictionary<string, PropertyInfo>> _indexedProperties = new();
|
||||
private static readonly Dictionary<Type, Dictionary<string, PropertyInfo>> _indexedProperties =
|
||||
new();
|
||||
private static readonly Lock _indexedPropertiesLockObject = new();
|
||||
|
||||
private static bool TryGetCachedProperty(Type type, string key, out PropertyInfo cachedProperty)
|
||||
@@ -15,7 +16,8 @@ public static class ObjectExtensions
|
||||
{
|
||||
if (!_indexedProperties.TryGetValue(type, out var properties))
|
||||
{
|
||||
properties = type.GetProperties().ToDictionary(prop => prop.GetJsonName(), prop => prop);
|
||||
properties = type.GetProperties()
|
||||
.ToDictionary(prop => prop.GetJsonName(), prop => prop);
|
||||
_indexedProperties.Add(type, properties);
|
||||
}
|
||||
|
||||
@@ -49,7 +51,7 @@ public static class ObjectExtensions
|
||||
return default;
|
||||
}
|
||||
|
||||
return (T?) cachedProperty.GetValue(obj);
|
||||
return (T?)cachedProperty.GetValue(obj);
|
||||
}
|
||||
|
||||
public static List<object> GetAllPropValuesAsList(this object? obj)
|
||||
|
||||
Reference in New Issue
Block a user