-
Notifications
You must be signed in to change notification settings - Fork 251
Open
Description
I encountered another issue regarding arrays.
I have a class with an array property:
public class Part {
public int Id { get; set; }
public int[] TaxonomyPath { get; set; }
}Now I want to query for all Parts where TaxonomyPath is in [[1, 2], [4,7], [3,9]]:
int[][] expected = [[1, 2], [4,7], [3,9]];
await dbContext.Parts
.Where(x => expected.Any(e => x.TaxonomyPath.SequenceEqual(e)))
.ToArrayAsync();This throws:
Expression 'unnest(@__existing_0) WITH ORDINALITY AS e(value)' in the SQL tree does not have a type mapping assigned.
When I change SequenceEqual to == it throws:
Couldn't find array type mapping when applying item/array mappings
Same when using Where(x => expected.Contains(x.TaxonomyPath).
Also when joining (which is the actual goal):
int[][] expected = [[1, 2], [4,7], [3,9]];
await dbContext.Parts
.Join(expected,
x => x.TaxonomyPath,
x => x,
(p, _) => p)
.ToArrayAsync();It throws:
Expression 'unnest(@__p_0) WITH ORDINALITY AS p(value)' in the SQL tree does not have a type mapping assigned.
I am using Npgsql.EntityFrameworkCore.PostgreSQL 9.0.4.
Metadata
Metadata
Assignees
Labels
No labels