Translation skipped for array accessed by relationship
See original GitHub issueWhile operation translations for simple types on owned entities are working well, array operations aren’t getting translated into sql query.
public class Entity
{
public int Id { get; set; }
public OwnedEntity OwnedEntity { get; set; }
}
public class OwnedEntity
{
public int[] 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
WHERE 1 = ANY (s."OwnedEntity_Array") = TRUE
Actual for: Npgsql.EntityFrameworkCore.PostgreSQL v2.2.0-preview1
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Using Skip and Take to pick up alternate items in an array
I have a string array with the following items: ... After the Skip then Take it returns 1 item in it so it...
Read more >Translation | Django documentation
translation (easily recognizable by the lazy suffix in their names) to translate strings lazily – when the value is accessed rather than when...
Read more >6 Native Format Builder Wizard
This chapter describes the Native Format Builder wizard, which enables you to create native schemas used for translation. It includes use cases and...
Read more >Schema and data type mapping in copy activity
For records where the array marked as collection reference is empty and the check box is selected, the entire record is skipped. Map ......
Read more >translate() - CSS: Cascading Style Sheets - MDN Web Docs
The translate() CSS function repositions an element in the horizontal and/or vertical directions. Its result is a data type.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yes, still interested… I need to wrap up a few more issues for 2.2 first, then I’ll give this a look. It may also be worth waiting for #541 to merge, since that has an effect on how array translations evaluate.
Sounds good to me, closing for now.