Closed aniekanBane closed 2 months ago
If the collection is IEnumerable
it works, right?
I think it's a bug on our side, I suppose we're targeting only IEnumerable ThenInclude EF extensions.
Hey @aniekanBane I'm testing this and I can't reproduce the issue. Now that I'm analyzing your code more closely, you actually have a projection. In the case of projections, EF ignores the Include statements anyway. There is something else going on. Can you post your mapping logic too?
@fiseni Apologies,
The error was from my dbContext configuration. My backing field did not match the navigation property.
I have added builder.Navigation.HasField() and it works now.
False Alarm 🚨
Exception thrown when using specification package with an IReadOnlyCollection navigation property but not if using dbContext directly or removing the then include.
Exception view
Example code
Entity
Specification
Service Call
Information
Ardalis.Specification == 8.0.0 Ardalis.Specification.EntityFrameworkCore == 8.0.0 Microsoft.EntityFrameworkCore == 8.0.8
.NET Core == 8