EFCore 8 - Owned type with navigation property not being included
Hello, i have an issue with EFCore (or maybe it's just me being pepega), but i have a class Score that have a Tracker field as an owned type:
And here is the tracker class:
and lastly the HitTracker class:
(obvisouly i'm only sending what's usefull here, it's not the whole classes but it doesn't matter)
My issue that that, when querying Context.RankedScore, including RankedScore.Score, then
Score.Trackers.HitTracker, i'm not getting any trackers. nor if i include them all the way like this:
I don't know if i should use a Owned class to achieve this behavior, but i simply wanted to have the child perperties wrapped into an object called Trackers so it makes more sence in the backend and in the front end, instead of doing Score.HitTracker, Score.Trackers.HitTracker seems better to me.
Does anyone know how to resolve my issue?
I'm getting this (it should include the HitTracker, not null, it doesn't include any of them actually)
Here is the output as sql (just the interesting part):
1 Reply
THe navigation might be wrong, but it's auto generated so i don't know, i do the classes first:
I just went Score.HitTracker, Score.AccuracyTracker, instead of wrapping them. Because i felt like this couldn't be helped without changing the onModelCreated, which i don't wznt to do.
If you guys had an explaination i would still be up to understand it..