Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
ObjectExtensions.cs
1using System.Reflection;
2
4{
8 public static class ObjectExtensions
9 {
17 public static KeyValuePair<string, object?>[] GetClassAndMethod(this object Obj, MethodBase? MethodInfo, string? Method = null)
18 {
19 return
20 [
21 new KeyValuePair<string, object?>("Class", Obj.GetType().Name),
22 new KeyValuePair<string, object?>("Method", Method ?? MethodInfo?.Name ?? "UNKNOWN")
23 ];
24 }
25 }
26}
Generic extension class for objects of type object.
static KeyValuePair< string, object?>[] GetClassAndMethod(this object Obj, MethodBase? MethodInfo, string? Method=null)
Returns the current class and method as a KeyValuePair<TKey,TValue>. For debugging purposes.