Class GeoLocJsonConverter
Json Converter for converting GeoLoc to and from JSON.
Inheritance
System.Object
System.Text.Json.Serialization.JsonConverter
System.Text.Json.Serialization.JsonConverter<GeoLoc>
GeoLocJsonConverter
Inherited Members
System.Text.Json.Serialization.JsonConverter<Redis.OM.Modeling.GeoLoc>.CanConvert(System.Type)
System.Text.Json.Serialization.JsonConverter<Redis.OM.Modeling.GeoLoc>.HandleNull
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Redis.OM.Modeling
Assembly: Redis.OM.dll
Syntax
public class GeoLocJsonConverter : JsonConverter<GeoLoc>
Methods
| Improve this Doc View SourceRead(ref Utf8JsonReader, Type, JsonSerializerOptions)
Parse JSON into a GeoLoc.
Declaration
public override GeoLoc Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Parameters
Type | Name | Description |
---|---|---|
System.Text.Json.Utf8JsonReader | reader | the reader. |
System.Type | typeToConvert | the type to convert. |
System.Text.Json.JsonSerializerOptions | options | the options. |
Returns
Type | Description |
---|---|
GeoLoc | A geoloc parsed from json. |
Overrides
System.Text.Json.Serialization.JsonConverter<Redis.OM.Modeling.GeoLoc>.Read(System.Text.Json.Utf8JsonReader, System.Type, System.Text.Json.JsonSerializerOptions)
Exceptions
Type | Condition |
---|---|
System.FormatException | thrown if geoloc not in valid format for parsing. |
Write(Utf8JsonWriter, GeoLoc, JsonSerializerOptions)
Writes the GeoLoc to a string for JSON.
Declaration
public override void Write(Utf8JsonWriter writer, GeoLoc value, JsonSerializerOptions options)
Parameters
Type | Name | Description |
---|---|---|
System.Text.Json.Utf8JsonWriter | writer | the writer. |
GeoLoc | value | the GeoLoc. |
System.Text.Json.JsonSerializerOptions | options | The options. |
Overrides
System.Text.Json.Serialization.JsonConverter<Redis.OM.Modeling.GeoLoc>.Write(System.Text.Json.Utf8JsonWriter, Redis.OM.Modeling.GeoLoc, System.Text.Json.JsonSerializerOptions)