Class NpgsqlJsonGeometryWktReaderWriter
- Namespace
- Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal
- Assembly
- Npgsql.EntityFrameworkCore.PostgreSQL.NetTopologySuite.dll
Reads and writes JSON using the well-known-text format for NetTopologySuite.Geometries.Geometry values.
public sealed class NpgsqlJsonGeometryWktReaderWriter : JsonValueReaderWriter<Geometry>
- Inheritance
-
JsonValueReaderWriter<Geometry>NpgsqlJsonGeometryWktReaderWriter
- Inherited Members
Properties
ConstructorExpression
The expression representing construction of this object.
public override Expression ConstructorExpression { get; }
Property Value
Instance
The singleton instance of this stateless reader/writer.
public static NpgsqlJsonGeometryWktReaderWriter Instance { get; }
Property Value
Methods
FromJsonTyped(ref Utf8JsonReaderManager, object?)
Reads the value from JSON.
public override Geometry FromJsonTyped(ref Utf8JsonReaderManager manager, object? existingObject = null)
Parameters
manager
Utf8JsonReaderManagerThe Utf8JsonReaderManager for the JSON being read.
existingObject
objectCan be used to update an existing object, rather than create a new one.
Returns
- Geometry
The read value.
Remarks
The CurrentReader is at the node that contains the value to be read. The value should be read as appropriate from the JSON, and then further converted as necessary.
Nulls are handled externally to this reader. That is, this method will never be called if the JSON value is "null".
In most cases, the value is represented in the JSON document as a simple property value--e.g. a number, boolean, or string. However, it could be an array or sub-document. In this case, the Utf8JsonReaderManager should be used to parse the JSON as appropriate.
ToJsonTyped(Utf8JsonWriter, Geometry)
Writes the value to JSON.
public override void ToJsonTyped(Utf8JsonWriter writer, Geometry value)
Parameters
writer
Utf8JsonWriterThe Utf8JsonWriter into which the value should be written.
value
GeometryThe value to write.