Join GitHub today
Nested Composite Array To List #2242
I have a composite PG type that nests an array of another composite type
CREATE TYPE ahm.monitoring_point_formula_cache_item AS (
CREATE TYPE ahm.monitoring_point_parameter_cache_item AS (
In C# I have a class structure that represents the above and both are registered correctly with the type mapper.
When running a query that returns ahm.monitoring_point_formula_cache_item I get the exception below when trying to read it from reader.
Object of type 'Pragma.OnKey.AHM.MonitoringPointReadings.MonitoringPointParameterCacheItem' cannot be converted to type 'System.Collections.Generic.List`1[Pragma.OnKey.AHM.MonitoringPointReadings.MonitoringPointParameterCacheItem]'.
When I change the Parameters property from List to an  it works fine. I was under the impression that  to List conversion was supported in npgsql, but I assume that it does not work for nested types.
Is this someting that can be supported in future?
Npgsql version: 4.0.2
The reason of it is the current implementation of
To fix it the handler must be changed to generate code via expression trees. This will also improve performance.
Yes I do map them up using
I quite like the idea of mapping to ROW using value tuples. Currently we using text::jsonb as input for some database validation queries, because we don't want to create strongly typed C# classes for each scenario we validate.