Skip to content

Commit

Permalink
Fixed CreateArrayHandler in ArrayHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
YohDeadfall committed May 17, 2018
1 parent 148003e commit bcee056
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
17 changes: 6 additions & 11 deletions src/Npgsql/TypeHandlers/ArrayHandler.cs
Expand Up @@ -21,7 +21,6 @@
// TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#endregion

using JetBrains.Annotations;
using Npgsql.BackendMessages;
using Npgsql.PostgresTypes;
using Npgsql.TypeHandling;
Expand All @@ -41,6 +40,12 @@ internal static class IsArrayOf<TArray, TElement>
{
public static readonly bool Value = typeof(TArray).IsArray && typeof(TArray).GetElementType() == typeof(TElement);
}

protected internal override ArrayHandler CreateArrayHandler(PostgresType arrayBackendType)
=> throw new NotSupportedException();

internal override NpgsqlTypeHandler CreateRangeHandler(PostgresType rangeBackendType)
=> throw new NotSupportedException();
}

/// <summary>
Expand Down Expand Up @@ -364,16 +369,6 @@ async Task WriteNonGeneric(ICollection value, NpgsqlWriteBuffer buf, NpgsqlLengt
}

#endregion

#region Misc

protected internal override ArrayHandler CreateArrayHandler(PostgresType arrayBackendType)
=> new ArrayHandler<short>(this) { PostgresType = arrayBackendType };

internal override NpgsqlTypeHandler CreateRangeHandler(PostgresType rangeBackendType)
=> throw new NotSupportedException();

#endregion
}

/// <remarks>
Expand Down
4 changes: 2 additions & 2 deletions src/Npgsql/TypeHandlers/BitStringHandler.cs
Expand Up @@ -55,8 +55,8 @@ internal override Type GetProviderSpecificFieldType(FieldDescription fieldDescri
=> GetFieldType(fieldDescription);

// BitString requires a special array handler which returns bool or BitArray
protected internal override ArrayHandler CreateArrayHandler(PostgresType backendType) =>
new BitStringArrayHandler(this) { PostgresType = backendType };
protected internal override ArrayHandler CreateArrayHandler(PostgresType backendType)
=> new BitStringArrayHandler(this) { PostgresType = backendType };

#region Read

Expand Down

0 comments on commit bcee056

Please sign in to comment.