Show / Hide Table of Contents

Class LineSegmentHandler

A type handler for the PostgreSQL lseg data type.

Inheritance
System.Object
NpgsqlTypeHandler
NpgsqlTypeHandler<NpgsqlLSeg>
NpgsqlSimpleTypeHandler<NpgsqlLSeg>
LineSegmentHandler
Implements
INpgsqlTypeHandler<NpgsqlLSeg>
INpgsqlSimpleTypeHandler<NpgsqlLSeg>
Inherited Members
NpgsqlSimpleTypeHandler<NpgsqlLSeg>.Read(NpgsqlReadBuffer, Int32, Boolean, FieldDescription)
NpgsqlSimpleTypeHandler<NpgsqlLSeg>.Read<TAny>(NpgsqlReadBuffer, Int32, Boolean, FieldDescription)
NpgsqlSimpleTypeHandler<NpgsqlLSeg>.Read<TAny>(NpgsqlReadBuffer, Int32, FieldDescription)
NpgsqlSimpleTypeHandler<NpgsqlLSeg>.ValidateAndGetLength<TAny>(TAny, NpgsqlLengthCache, NpgsqlParameter)
NpgsqlSimpleTypeHandler<NpgsqlLSeg>.Write(NpgsqlLSeg, NpgsqlWriteBuffer, NpgsqlLengthCache, NpgsqlParameter, Boolean)
NpgsqlSimpleTypeHandler<NpgsqlLSeg>.ValidateAndGetLength(NpgsqlLSeg, NpgsqlLengthCache, NpgsqlParameter)
NpgsqlSimpleTypeHandler<NpgsqlLSeg>.ValidateObjectAndGetLength(Object, NpgsqlLengthCache, NpgsqlParameter)
NpgsqlSimpleTypeHandler<NpgsqlLSeg>.WriteObjectWithLength(Object, NpgsqlWriteBuffer, NpgsqlLengthCache, NpgsqlParameter, Boolean)
NpgsqlTypeHandler<NpgsqlLSeg>.WriteWithLength<TAny>(TAny, NpgsqlWriteBuffer, NpgsqlLengthCache, NpgsqlParameter, Boolean)
NpgsqlTypeHandler<NpgsqlLSeg>.CreateArrayHandler(PostgresArrayType)
NpgsqlTypeHandler<NpgsqlLSeg>.CreateRangeHandler(PostgresRangeType)
NpgsqlTypeHandler.CreateConversionButNoParamException(Type)
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()
Namespace: Npgsql.TypeHandlers.GeometricHandlers
Assembly: Npgsql.dll
Syntax
public class LineSegmentHandler : NpgsqlSimpleTypeHandler<NpgsqlLSeg>, INpgsqlTypeHandler<NpgsqlLSeg>, INpgsqlSimpleTypeHandler<NpgsqlLSeg>
Remarks

See http://www.postgresql.org/docs/current/static/datatype-geometric.html.

The type handler API allows customizing Npgsql's behavior in powerful ways. However, although it is public, it should be considered somewhat unstable, and may change in breaking ways, including in non-major releases. Use it at your own risk.

Constructors

LineSegmentHandler(PostgresType)

Declaration
public LineSegmentHandler(PostgresType postgresType)
Parameters
Type Name Description
PostgresType postgresType

Methods

Read(NpgsqlReadBuffer, Int32, FieldDescription)

Reads a value of type TDefault with the given length from the provided buffer, with the assumption that it is entirely present in the provided memory buffer and no I/O will be required.

Declaration
public override NpgsqlLSeg Read(NpgsqlReadBuffer buf, int len, FieldDescription fieldDescription = null)
Parameters
Type Name Description
NpgsqlReadBuffer buf

The buffer from which to read.

System.Int32 len

The byte length of the value. The buffer might not contain the full length, requiring I/O to be performed.

FieldDescription fieldDescription

Additional PostgreSQL information about the type, such as the length in varchar(30).

Returns
Type Description
NpgsqlLSeg

The fully-read value.

Overrides
Npgsql.TypeHandling.NpgsqlSimpleTypeHandler<NpgsqlTypes.NpgsqlLSeg>.Read(Npgsql.NpgsqlReadBuffer, System.Int32, Npgsql.BackendMessages.FieldDescription)

ValidateAndGetLength(NpgsqlLSeg, NpgsqlParameter)

Responsible for validating that a value represents a value of the correct and which can be written for PostgreSQL - if the value cannot be written for any reason, an exception shold be thrown. Also returns the byte length needed to write the value.

Declaration
public override int ValidateAndGetLength(NpgsqlLSeg value, NpgsqlParameter parameter)
Parameters
Type Name Description
NpgsqlLSeg value
NpgsqlParameter parameter

The NpgsqlParameter instance where this value resides. Can be used to access additional information relevant to the write process (e.g. Size).

Returns
Type Description
System.Int32

The number of bytes required to write the value.

Overrides
Npgsql.TypeHandling.NpgsqlSimpleTypeHandler<NpgsqlTypes.NpgsqlLSeg>.ValidateAndGetLength(NpgsqlTypes.NpgsqlLSeg, Npgsql.NpgsqlParameter)

Write(NpgsqlLSeg, NpgsqlWriteBuffer, NpgsqlParameter)

Writes a value to the provided buffer, with the assumption that there is enough space in the buffer (no I/O will occur). The Npgsql core will have taken care of that.

Declaration
public override void Write(NpgsqlLSeg value, NpgsqlWriteBuffer buf, NpgsqlParameter parameter)
Parameters
Type Name Description
NpgsqlLSeg value
NpgsqlWriteBuffer buf

The buffer to which to write.

NpgsqlParameter parameter

The NpgsqlParameter instance where this value resides. Can be used to access additional information relevant to the write process (e.g. Size).

Overrides
Npgsql.TypeHandling.NpgsqlSimpleTypeHandler<NpgsqlTypes.NpgsqlLSeg>.Write(NpgsqlTypes.NpgsqlLSeg, Npgsql.NpgsqlWriteBuffer, Npgsql.NpgsqlParameter)

Implements

INpgsqlTypeHandler<T>
INpgsqlSimpleTypeHandler<T>
In This Article
Back to top Generated by DocFX