forked from npgsql/npgsql
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVoidHandler.cs
More file actions
26 lines (22 loc) · 881 Bytes
/
VoidHandler.cs
File metadata and controls
26 lines (22 loc) · 881 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
using System;
using Npgsql.BackendMessages;
using Npgsql.PostgresTypes;
using Npgsql.TypeHandling;
using Npgsql.TypeMapping;
namespace Npgsql.TypeHandlers
{
/// <remarks>
/// http://www.postgresql.org/docs/current/static/datatype-boolean.html
/// </remarks>
[TypeMapping("void")]
class VoidHandler : NpgsqlSimpleTypeHandler<DBNull>
{
public VoidHandler(PostgresType postgresType) : base(postgresType) {}
public override DBNull Read(NpgsqlReadBuffer buf, int len, FieldDescription? fieldDescription = null)
=> DBNull.Value;
public override int ValidateAndGetLength(DBNull value, NpgsqlParameter? parameter)
=> throw new NotSupportedException();
public override void Write(DBNull value, NpgsqlWriteBuffer buf, NpgsqlParameter? parameter)
=> throw new NotSupportedException();
}
}