### YamlMime:ManagedReference items: - uid: MLEM.Data.Json.JsonTypeSafeWrapper commentId: T:MLEM.Data.Json.JsonTypeSafeWrapper id: JsonTypeSafeWrapper parent: MLEM.Data.Json children: - MLEM.Data.Json.JsonTypeSafeWrapper.GetValue``1 - MLEM.Data.Json.JsonTypeSafeWrapper.Of``1(``0) - MLEM.Data.Json.JsonTypeSafeWrapper.Value langs: - csharp - vb name: JsonTypeSafeWrapper nameWithType: JsonTypeSafeWrapper fullName: MLEM.Data.Json.JsonTypeSafeWrapper type: Class source: remote: path: MLEM.Data/Json/JsonTypeSafeWrapper.cs branch: main repo: https://github.com/Ellpeck/MLEM id: JsonTypeSafeWrapper path: ../MLEM.Data/Json/JsonTypeSafeWrapper.cs startLine: 11 assemblies: - MLEM.Data namespace: MLEM.Data.Json summary: >- A json type-safe wrapper can be used to wrap any objects that have a custom which stores them as a primitive type and that are serialized using a in cases where is not set to . If these objects are not wrapped in this manner, the value deserialized from it might not have the same type as the originally serialized object. This behavior can be observed, for example, when serializing a of entries, one of which is a : The will be serialized as a and, upon deserialization, will remain a . In general, wrapping objects in this manner is only useful in rare cases, where custom data of an unexpected or unknown type is stored. See for an example of how this class can be used, and see this stackoverflow answer for more information on the problem that this class solves: https://stackoverflow.com/a/38798114. example: [] syntax: content: public abstract class JsonTypeSafeWrapper content.vb: Public MustInherit Class JsonTypeSafeWrapper inheritance: - System.Object derivedClasses: - MLEM.Data.Json.JsonTypeSafeWrapper`1 inheritedMembers: - System.Object.ToString - System.Object.Equals(System.Object) - System.Object.Equals(System.Object,System.Object) - System.Object.ReferenceEquals(System.Object,System.Object) - System.Object.GetHashCode - System.Object.GetType - System.Object.MemberwiseClone - uid: MLEM.Data.Json.JsonTypeSafeWrapper.Value commentId: P:MLEM.Data.Json.JsonTypeSafeWrapper.Value id: Value parent: MLEM.Data.Json.JsonTypeSafeWrapper langs: - csharp - vb name: Value nameWithType: JsonTypeSafeWrapper.Value fullName: MLEM.Data.Json.JsonTypeSafeWrapper.Value type: Property source: remote: path: MLEM.Data/Json/JsonTypeSafeWrapper.cs branch: main repo: https://github.com/Ellpeck/MLEM id: Value path: ../MLEM.Data/Json/JsonTypeSafeWrapper.cs startLine: 16 assemblies: - MLEM.Data namespace: MLEM.Data.Json summary: Returns this json type-safe wrapper's value as an . example: [] syntax: content: >- [JsonIgnore] public abstract object Value { get; } parameters: [] return: type: System.Object content.vb: >- Public MustOverride ReadOnly Property Value As Object overload: MLEM.Data.Json.JsonTypeSafeWrapper.Value* attributes: - type: Newtonsoft.Json.JsonIgnoreAttribute ctor: Newtonsoft.Json.JsonIgnoreAttribute.#ctor arguments: [] - uid: MLEM.Data.Json.JsonTypeSafeWrapper.GetValue``1 commentId: M:MLEM.Data.Json.JsonTypeSafeWrapper.GetValue``1 id: GetValue``1 parent: MLEM.Data.Json.JsonTypeSafeWrapper langs: - csharp - vb name: GetValue() nameWithType: JsonTypeSafeWrapper.GetValue() fullName: MLEM.Data.Json.JsonTypeSafeWrapper.GetValue() type: Method source: remote: path: MLEM.Data/Json/JsonTypeSafeWrapper.cs branch: main repo: https://github.com/Ellpeck/MLEM id: GetValue path: ../MLEM.Data/Json/JsonTypeSafeWrapper.cs startLine: 25 assemblies: - MLEM.Data namespace: MLEM.Data.Json summary: >- Returns the current of this , typecast to the given type T. If this 's type is incompatible with the given type, the type's default value is returned instead. example: [] syntax: content: public T GetValue() typeParameters: - id: T description: The type of value to return return: type: '{T}' description: The , castt to the given type if compatible, otherwise default content.vb: Public Function GetValue(Of T)() As T overload: MLEM.Data.Json.JsonTypeSafeWrapper.GetValue* nameWithType.vb: JsonTypeSafeWrapper.GetValue(Of T)() fullName.vb: MLEM.Data.Json.JsonTypeSafeWrapper.GetValue(Of T)() name.vb: GetValue(Of T)() - uid: MLEM.Data.Json.JsonTypeSafeWrapper.Of``1(``0) commentId: M:MLEM.Data.Json.JsonTypeSafeWrapper.Of``1(``0) id: Of``1(``0) parent: MLEM.Data.Json.JsonTypeSafeWrapper langs: - csharp - vb name: Of(T) nameWithType: JsonTypeSafeWrapper.Of(T) fullName: MLEM.Data.Json.JsonTypeSafeWrapper.Of(T) type: Method source: remote: path: MLEM.Data/Json/JsonTypeSafeWrapper.cs branch: main repo: https://github.com/Ellpeck/MLEM id: Of path: ../MLEM.Data/Json/JsonTypeSafeWrapper.cs startLine: 39 assemblies: - MLEM.Data namespace: MLEM.Data.Json summary: >- Creates a new from the given value. The type parameter of the returned wrapper will be equal to the of the value passed, even if it is a subtype of T. If a for a specific type, known at compile type, should be created, you can use . example: [] syntax: content: public static JsonTypeSafeWrapper Of(T value) parameters: - id: value type: '{T}' description: The value to wrap typeParameters: - id: T return: type: MLEM.Data.Json.JsonTypeSafeWrapper description: A with a type matching the type of value content.vb: Public Shared Function [Of](Of T)(value As T) As JsonTypeSafeWrapper overload: MLEM.Data.Json.JsonTypeSafeWrapper.Of* nameWithType.vb: JsonTypeSafeWrapper.Of(Of T)(T) fullName.vb: MLEM.Data.Json.JsonTypeSafeWrapper.Of(Of T)(T) name.vb: Of(Of T)(T) references: - uid: Newtonsoft.Json.JsonConverter commentId: T:Newtonsoft.Json.JsonConverter parent: Newtonsoft.Json isExternal: true name: JsonConverter nameWithType: JsonConverter fullName: Newtonsoft.Json.JsonConverter - uid: Newtonsoft.Json.JsonSerializer commentId: T:Newtonsoft.Json.JsonSerializer parent: Newtonsoft.Json isExternal: true name: JsonSerializer nameWithType: JsonSerializer fullName: Newtonsoft.Json.JsonSerializer - uid: Newtonsoft.Json.JsonSerializer.TypeNameHandling commentId: P:Newtonsoft.Json.JsonSerializer.TypeNameHandling isExternal: true name: TypeNameHandling nameWithType: JsonSerializer.TypeNameHandling fullName: Newtonsoft.Json.JsonSerializer.TypeNameHandling - uid: Newtonsoft.Json.TypeNameHandling.None commentId: F:Newtonsoft.Json.TypeNameHandling.None isExternal: true name: None nameWithType: TypeNameHandling.None fullName: Newtonsoft.Json.TypeNameHandling.None - uid: System.Collections.Generic.List`1 commentId: T:System.Collections.Generic.List`1 isExternal: true href: https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1 name: List nameWithType: List fullName: System.Collections.Generic.List nameWithType.vb: List(Of T) fullName.vb: System.Collections.Generic.List(Of T) name.vb: List(Of T) spec.csharp: - uid: System.Collections.Generic.List`1 name: List isExternal: true href: https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1 - name: < - name: T - name: '>' spec.vb: - uid: System.Collections.Generic.List`1 name: List isExternal: true href: https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1 - name: ( - name: Of - name: " " - name: T - name: ) - uid: System.Object commentId: T:System.Object parent: System isExternal: true href: https://learn.microsoft.com/dotnet/api/system.object name: object nameWithType: object fullName: object nameWithType.vb: Object fullName.vb: Object name.vb: Object - uid: System.TimeSpan commentId: T:System.TimeSpan parent: System isExternal: true href: https://learn.microsoft.com/dotnet/api/system.timespan name: TimeSpan nameWithType: TimeSpan fullName: System.TimeSpan - uid: System.String commentId: T:System.String parent: System isExternal: true href: https://learn.microsoft.com/dotnet/api/system.string name: string nameWithType: string fullName: string nameWithType.vb: String fullName.vb: String name.vb: String - uid: MLEM.Data.Json.JsonTypeSafeGenericDataHolder commentId: T:MLEM.Data.Json.JsonTypeSafeGenericDataHolder href: MLEM.Data.Json.JsonTypeSafeGenericDataHolder.html name: JsonTypeSafeGenericDataHolder nameWithType: JsonTypeSafeGenericDataHolder fullName: MLEM.Data.Json.JsonTypeSafeGenericDataHolder - uid: MLEM.Data.Json commentId: N:MLEM.Data.Json href: MLEM.html name: MLEM.Data.Json nameWithType: MLEM.Data.Json fullName: MLEM.Data.Json spec.csharp: - uid: MLEM name: MLEM href: MLEM.html - name: . - uid: MLEM.Data name: Data href: MLEM.Data.html - name: . - uid: MLEM.Data.Json name: Json href: MLEM.Data.Json.html spec.vb: - uid: MLEM name: MLEM href: MLEM.html - name: . - uid: MLEM.Data name: Data href: MLEM.Data.html - name: . - uid: MLEM.Data.Json name: Json href: MLEM.Data.Json.html - uid: System.Object.ToString commentId: M:System.Object.ToString parent: System.Object isExternal: true href: https://learn.microsoft.com/dotnet/api/system.object.tostring name: ToString() nameWithType: object.ToString() fullName: object.ToString() nameWithType.vb: Object.ToString() fullName.vb: Object.ToString() spec.csharp: - uid: System.Object.ToString name: ToString isExternal: true href: https://learn.microsoft.com/dotnet/api/system.object.tostring - name: ( - name: ) spec.vb: - uid: System.Object.ToString name: ToString isExternal: true href: https://learn.microsoft.com/dotnet/api/system.object.tostring - name: ( - name: ) - uid: System.Object.Equals(System.Object) commentId: M:System.Object.Equals(System.Object) parent: System.Object isExternal: true href: https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object) name: Equals(object) nameWithType: object.Equals(object) fullName: object.Equals(object) nameWithType.vb: Object.Equals(Object) fullName.vb: Object.Equals(Object) name.vb: Equals(Object) spec.csharp: - uid: System.Object.Equals(System.Object) name: Equals isExternal: true href: https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object) - name: ( - uid: System.Object name: object isExternal: true href: https://learn.microsoft.com/dotnet/api/system.object - name: ) spec.vb: - uid: System.Object.Equals(System.Object) name: Equals isExternal: true href: https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object) - name: ( - uid: System.Object name: Object isExternal: true href: https://learn.microsoft.com/dotnet/api/system.object - name: ) - uid: System.Object.Equals(System.Object,System.Object) commentId: M:System.Object.Equals(System.Object,System.Object) parent: System.Object isExternal: true href: https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object) name: Equals(object, object) nameWithType: object.Equals(object, object) fullName: object.Equals(object, object) nameWithType.vb: Object.Equals(Object, Object) fullName.vb: Object.Equals(Object, Object) name.vb: Equals(Object, Object) spec.csharp: - uid: System.Object.Equals(System.Object,System.Object) name: Equals isExternal: true href: https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object) - name: ( - uid: System.Object name: object isExternal: true href: https://learn.microsoft.com/dotnet/api/system.object - name: ',' - name: " " - uid: System.Object name: object isExternal: true href: https://learn.microsoft.com/dotnet/api/system.object - name: ) spec.vb: - uid: System.Object.Equals(System.Object,System.Object) name: Equals isExternal: true href: https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object) - name: ( - uid: System.Object name: Object isExternal: true href: https://learn.microsoft.com/dotnet/api/system.object - name: ',' - name: " " - uid: System.Object name: Object isExternal: true href: https://learn.microsoft.com/dotnet/api/system.object - name: ) - uid: System.Object.ReferenceEquals(System.Object,System.Object) commentId: M:System.Object.ReferenceEquals(System.Object,System.Object) parent: System.Object isExternal: true href: https://learn.microsoft.com/dotnet/api/system.object.referenceequals name: ReferenceEquals(object, object) nameWithType: object.ReferenceEquals(object, object) fullName: object.ReferenceEquals(object, object) nameWithType.vb: Object.ReferenceEquals(Object, Object) fullName.vb: Object.ReferenceEquals(Object, Object) name.vb: ReferenceEquals(Object, Object) spec.csharp: - uid: System.Object.ReferenceEquals(System.Object,System.Object) name: ReferenceEquals isExternal: true href: https://learn.microsoft.com/dotnet/api/system.object.referenceequals - name: ( - uid: System.Object name: object isExternal: true href: https://learn.microsoft.com/dotnet/api/system.object - name: ',' - name: " " - uid: System.Object name: object isExternal: true href: https://learn.microsoft.com/dotnet/api/system.object - name: ) spec.vb: - uid: System.Object.ReferenceEquals(System.Object,System.Object) name: ReferenceEquals isExternal: true href: https://learn.microsoft.com/dotnet/api/system.object.referenceequals - name: ( - uid: System.Object name: Object isExternal: true href: https://learn.microsoft.com/dotnet/api/system.object - name: ',' - name: " " - uid: System.Object name: Object isExternal: true href: https://learn.microsoft.com/dotnet/api/system.object - name: ) - uid: System.Object.GetHashCode commentId: M:System.Object.GetHashCode parent: System.Object isExternal: true href: https://learn.microsoft.com/dotnet/api/system.object.gethashcode name: GetHashCode() nameWithType: object.GetHashCode() fullName: object.GetHashCode() nameWithType.vb: Object.GetHashCode() fullName.vb: Object.GetHashCode() spec.csharp: - uid: System.Object.GetHashCode name: GetHashCode isExternal: true href: https://learn.microsoft.com/dotnet/api/system.object.gethashcode - name: ( - name: ) spec.vb: - uid: System.Object.GetHashCode name: GetHashCode isExternal: true href: https://learn.microsoft.com/dotnet/api/system.object.gethashcode - name: ( - name: ) - uid: System.Object.GetType commentId: M:System.Object.GetType parent: System.Object isExternal: true href: https://learn.microsoft.com/dotnet/api/system.object.gettype name: GetType() nameWithType: object.GetType() fullName: object.GetType() nameWithType.vb: Object.GetType() fullName.vb: Object.GetType() spec.csharp: - uid: System.Object.GetType name: GetType isExternal: true href: https://learn.microsoft.com/dotnet/api/system.object.gettype - name: ( - name: ) spec.vb: - uid: System.Object.GetType name: GetType isExternal: true href: https://learn.microsoft.com/dotnet/api/system.object.gettype - name: ( - name: ) - uid: System.Object.MemberwiseClone commentId: M:System.Object.MemberwiseClone parent: System.Object isExternal: true href: https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone name: MemberwiseClone() nameWithType: object.MemberwiseClone() fullName: object.MemberwiseClone() nameWithType.vb: Object.MemberwiseClone() fullName.vb: Object.MemberwiseClone() spec.csharp: - uid: System.Object.MemberwiseClone name: MemberwiseClone isExternal: true href: https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone - name: ( - name: ) spec.vb: - uid: System.Object.MemberwiseClone name: MemberwiseClone isExternal: true href: https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone - name: ( - name: ) - uid: Newtonsoft.Json commentId: N:Newtonsoft.Json isExternal: true name: Newtonsoft.Json nameWithType: Newtonsoft.Json fullName: Newtonsoft.Json spec.csharp: - uid: Newtonsoft name: Newtonsoft isExternal: true - name: . - uid: Newtonsoft.Json name: Json isExternal: true spec.vb: - uid: Newtonsoft name: Newtonsoft isExternal: true - name: . - uid: Newtonsoft.Json name: Json isExternal: true - uid: System commentId: N:System isExternal: true href: https://learn.microsoft.com/dotnet/api/system name: System nameWithType: System fullName: System - uid: MLEM.Data.Json.JsonTypeSafeWrapper.Value* commentId: Overload:MLEM.Data.Json.JsonTypeSafeWrapper.Value href: MLEM.Data.Json.JsonTypeSafeWrapper.html#MLEM_Data_Json_JsonTypeSafeWrapper_Value name: Value nameWithType: JsonTypeSafeWrapper.Value fullName: MLEM.Data.Json.JsonTypeSafeWrapper.Value - uid: MLEM.Data.Json.JsonTypeSafeWrapper.Value commentId: P:MLEM.Data.Json.JsonTypeSafeWrapper.Value parent: MLEM.Data.Json.JsonTypeSafeWrapper href: MLEM.Data.Json.JsonTypeSafeWrapper.html#MLEM_Data_Json_JsonTypeSafeWrapper_Value name: Value nameWithType: JsonTypeSafeWrapper.Value fullName: MLEM.Data.Json.JsonTypeSafeWrapper.Value - uid: MLEM.Data.Json.JsonTypeSafeWrapper commentId: T:MLEM.Data.Json.JsonTypeSafeWrapper parent: MLEM.Data.Json href: MLEM.Data.Json.JsonTypeSafeWrapper.html name: JsonTypeSafeWrapper nameWithType: JsonTypeSafeWrapper fullName: MLEM.Data.Json.JsonTypeSafeWrapper - uid: MLEM.Data.Json.JsonTypeSafeWrapper.GetValue* commentId: Overload:MLEM.Data.Json.JsonTypeSafeWrapper.GetValue href: MLEM.Data.Json.JsonTypeSafeWrapper.html#MLEM_Data_Json_JsonTypeSafeWrapper_GetValue__1 name: GetValue nameWithType: JsonTypeSafeWrapper.GetValue fullName: MLEM.Data.Json.JsonTypeSafeWrapper.GetValue - uid: '{T}' commentId: '!:T' definition: T name: T nameWithType: T fullName: T - uid: T name: T nameWithType: T fullName: T - uid: MLEM.Data.Json.JsonTypeSafeWrapper`1 commentId: T:MLEM.Data.Json.JsonTypeSafeWrapper`1 href: MLEM.Data.Json.JsonTypeSafeWrapper-1.html name: JsonTypeSafeWrapper nameWithType: JsonTypeSafeWrapper fullName: MLEM.Data.Json.JsonTypeSafeWrapper nameWithType.vb: JsonTypeSafeWrapper(Of T) fullName.vb: MLEM.Data.Json.JsonTypeSafeWrapper(Of T) name.vb: JsonTypeSafeWrapper(Of T) spec.csharp: - uid: MLEM.Data.Json.JsonTypeSafeWrapper`1 name: JsonTypeSafeWrapper href: MLEM.Data.Json.JsonTypeSafeWrapper-1.html - name: < - name: T - name: '>' spec.vb: - uid: MLEM.Data.Json.JsonTypeSafeWrapper`1 name: JsonTypeSafeWrapper href: MLEM.Data.Json.JsonTypeSafeWrapper-1.html - name: ( - name: Of - name: " " - name: T - name: ) - uid: System.Type commentId: T:System.Type parent: System isExternal: true href: https://learn.microsoft.com/dotnet/api/system.type name: Type nameWithType: Type fullName: System.Type - uid: MLEM.Data.Json.JsonTypeSafeWrapper`1.#ctor(`0) commentId: M:MLEM.Data.Json.JsonTypeSafeWrapper`1.#ctor(`0) href: MLEM.Data.Json.JsonTypeSafeWrapper-1.html#MLEM_Data_Json_JsonTypeSafeWrapper_1__ctor__0_ name: JsonTypeSafeWrapper(T) nameWithType: JsonTypeSafeWrapper.JsonTypeSafeWrapper(T) fullName: MLEM.Data.Json.JsonTypeSafeWrapper.JsonTypeSafeWrapper(T) nameWithType.vb: JsonTypeSafeWrapper(Of T).New(T) fullName.vb: MLEM.Data.Json.JsonTypeSafeWrapper(Of T).New(T) name.vb: New(T) spec.csharp: - uid: MLEM.Data.Json.JsonTypeSafeWrapper`1.#ctor(`0) name: JsonTypeSafeWrapper href: MLEM.Data.Json.JsonTypeSafeWrapper-1.html#MLEM_Data_Json_JsonTypeSafeWrapper_1__ctor__0_ - name: ( - name: T - name: ) spec.vb: - name: New - name: ( - name: T - name: ) - uid: MLEM.Data.Json.JsonTypeSafeWrapper.Of* commentId: Overload:MLEM.Data.Json.JsonTypeSafeWrapper.Of href: MLEM.Data.Json.JsonTypeSafeWrapper.html#MLEM_Data_Json_JsonTypeSafeWrapper_Of__1___0_ name: Of nameWithType: JsonTypeSafeWrapper.Of fullName: MLEM.Data.Json.JsonTypeSafeWrapper.Of