Skip to content

Translation skipped for array accessed by relationship #651

Description

@AlenitsynMM

While operation translations for simple types on owned entities are working well, array operations aren't getting translated into sql query.

publicclassEntity{publicintId{get;set;}publicOwnedEntityOwnedEntity{get;set;}}publicclassOwnedEntity{publicint[]Array{get;set;}}

Configuration:

modelBuilder.Entity<Entity>(
builder =>{builder.HasKey(s =>s.Id);builder.OwnsOne(
s =>s.OwnedEntity,
ownershipBuilder =>{ownershipBuilder.Property(entity =>entity.Array).IsRequired();});});

LINQ:

context.Set<Entity>().Where(s =>s.OwnedEntity.Array.Contains(1)).ToList();

Actual sql query:

SELECT s."Id", s."Id", s."OwnedEntity_Array"FROM"Entity"AS s

Expected sql query:

SELECT s."Id", s."OwnedEntity_Array"FROM"Entity"AS s
WHERE1= ANY (s."OwnedEntity_Array") = TRUE

Actual for: Npgsql.EntityFrameworkCore.PostgreSQL v2.2.0-preview1

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions