Search code examples
c#postgresqlentity-frameworknpgsqlef-postgresql

EF PostgreeSQL array_append


I want append a item to column with type int[]. i see PostgreSQL document with array_append can do this. but how can we do this with EF Core? (i use Npgsql.EntityFrameworkCore.PostgreSQL)


Solution

  • This currently isn't supported (the list of supported array translations can be found here).

    In the meantime, as a workaround you can use raw SQL queries to express your query directly in SQL, and possibly compose additional LINQ operators over that.

    EDIT: opened https://github.com/npgsql/efcore.pg/issues/2026 to track, this should be doable for 6.0.