add ToPropertyDictionary to convert Dictionary<string, object?> to Dictionary<string, string?>
This commit is contained in:
parent
6cf47dc617
commit
4b8217bb80
@ -15,6 +15,14 @@ public static class ObjectExtensions
|
||||
prop => prop.GetValue(obj).ToSafeString()
|
||||
);
|
||||
}
|
||||
public static Dictionary<string, string?> ToPropertyDictionary(this Dictionary<string, object?> obj)
|
||||
{
|
||||
return obj
|
||||
.ToDictionary(
|
||||
prop => prop.Key,
|
||||
prop => prop.Value?.ToString()
|
||||
);
|
||||
}
|
||||
|
||||
public static string? ToSafeString(this object? obj)
|
||||
=> obj is bool b
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user