Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

HasOne relationship on Owned type not working as expected with Cosmos #15245

Closed
altick opened this issue Apr 3, 2019 · 1 comment
Closed
Labels
closed-out-of-scope This is not something that will be fixed/implemented and the issue is closed. customer-reported punted-for-3.0

Comments

@altick
Copy link

altick commented Apr 3, 2019

I have the one-to-many relationship configured between Membership (owned by Activity entity) and entity User. When I select all activities I get back results where only the first activity's membership contains the instance of the user entity. For the rest of the results the users are set to null.

However when I create all entities and query the activities within the same instance of the context I receive the expected results, i.e. all users are set for all memberships.

This is a snippet of how the relationship between Membership and User is configured:

builder.OwnsMany(a => a.Members)
           .HasOne(m => m.User)
           .WithMany()
           .HasForeignKey(m => m.UserId);

This is a snippet of how the activities are queried:

var activities = context.Activities
                .Include(a => a.Members)
                .ThenInclude(m => m.User)
                .ToArray();

Please, check out the solution with the repro for the further details
(configured for the local emulator)

Further technical details

EF Core version: 3.0.0-preview3.19153.1
Database Provider: Microsoft.EntityFrameworkCore.Cosmos 3.0.0-preview3.19153.1
Operating system: Win 10
IDE: Visual Studio 2019 Preview 4.3

@smitpatel
Copy link
Contributor

Blocked on #16920
The query is doing cross collection include.

@ajcvickers ajcvickers modified the milestones: 6.0.0, Backlog Nov 6, 2020
@ajcvickers ajcvickers added closed-out-of-scope This is not something that will be fixed/implemented and the issue is closed. and removed propose-punt type-bug blocked area-cosmos labels Nov 10, 2021
@ajcvickers ajcvickers removed this from the Backlog milestone Nov 10, 2021
@ajcvickers ajcvickers reopened this Oct 16, 2022
@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
closed-out-of-scope This is not something that will be fixed/implemented and the issue is closed. customer-reported punted-for-3.0
Projects
None yet
Development

No branches or pull requests

3 participants