-
Notifications
You must be signed in to change notification settings - Fork 254
Open
Milestone
Description
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 starts with [1, 2]:
int[] expected = [1, 2];
await dbContext.Parts
.Where(x => x.TaxonomyPath.Take(2).SequenceEquals(expected))
.ToArrayAsync();I expect this to translate to WHERE "TaxonomyPath"[1:2] = ARRAY[1,2]. Unfortunately this query can't be translated by Npgsql.EntityFrameworkCore.PostgreSQL 9.0.4.
The interesting thing is that Take(2) alone can be translated, and SequenceEquals alone can also be translated.
Is there any way to work around this limitations until this gets fixed (except restored to RawSql)?
I think this is really useful for working with hierarchical tree-like data!
Metadata
Metadata
Assignees
Labels
No labels