about summary refs log tree commit diff
path: root/MatrixRoomUtils.Core/StateEvent.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MatrixRoomUtils.Core/StateEvent.cs')
-rw-r--r--MatrixRoomUtils.Core/StateEvent.cs15
1 files changed, 14 insertions, 1 deletions
diff --git a/MatrixRoomUtils.Core/StateEvent.cs b/MatrixRoomUtils.Core/StateEvent.cs

index f98d963..6321fb6 100644 --- a/MatrixRoomUtils.Core/StateEvent.cs +++ b/MatrixRoomUtils.Core/StateEvent.cs
@@ -24,6 +24,19 @@ public class StateEvent { return (StateEvent<T>)this; } + + public string dtype + { + get + { + string res = GetType().Name switch + { + "StateEvent`1" => $"StateEvent<{Content.GetType().Name}>", + _ => GetType().Name + }; + return res; + } + } } public class StateEvent<T> : StateEvent where T : class @@ -38,5 +51,5 @@ public class StateEvent<T> : StateEvent where T : class } } [JsonPropertyName("content")] - public T Content { get; set; } + public new T Content { get; set; } } \ No newline at end of file