diff --git a/src/EFCore.PG/Storage/Internal/Mapping/NpgsqlArrayTypeMapping.cs b/src/EFCore.PG/Storage/Internal/Mapping/NpgsqlArrayTypeMapping.cs index 052d653e4..a336b1148 100644 --- a/src/EFCore.PG/Storage/Internal/Mapping/NpgsqlArrayTypeMapping.cs +++ b/src/EFCore.PG/Storage/Internal/Mapping/NpgsqlArrayTypeMapping.cs @@ -190,7 +190,7 @@ protected NpgsqlArrayTypeMapping(RelationalTypeMappingParameters parameters) // Otherwise let the ADO.NET layer infer the PostgreSQL type. We can't always let it infer, otherwise // when given a byte[] it will infer byte (but we want smallint[]) NpgsqlDbType = NpgsqlTypes.NpgsqlDbType.Array - | (ElementTypeMapping is INpgsqlTypeMapping elementNpgsqlTypeMapping + | (ElementTypeMapping is INpgsqlTypeMapping { NpgsqlDbType: not NpgsqlTypes.NpgsqlDbType.Unknown } elementNpgsqlTypeMapping ? elementNpgsqlTypeMapping.NpgsqlDbType : ElementTypeMapping.DbType.HasValue ? new NpgsqlParameter { DbType = ElementTypeMapping.DbType.Value }.NpgsqlDbType