11 Replies
Impossible to tell without code
But my bet is you're either using lazy loading or using
.Include()
to get entities for display@ZZZZZZZZZZZZZZZZZZZZZZZZZ It's appearing when declaring the relationship between entities.
For instance here:
It's appearing on top of
Department
. It's working fine. I'm just trying to understand the message properly.I guess it's just warning you that if you try to fetch this data in a stupid way you can run into a cyclic reference
I see, this is the proper way of doing it right? Or have i got it all wrong.
could it be that
Department
also has a nav prop for List<Shift>
?
Yes.
Fetching data? Always
.Select()
into DTOsAlways select into DTOs, and model your DTOs to remove any dependency loops
its fine to have reference cycles in your models (not your DTOs), but dont try to serialize that
Oh I see, otherwise Shifts will have a department and the department will have shifts and so on and so forth.
I get it.
Thanks you guys very much.
which is fine in terms of C# objects
but its not fine in JSON :p
Got it. Thanks guys. I really appreciate it.