With the transition from .net 5 to .net 8, the following warning began to fly:
An error was generated for warning ‘Microsoft.EntityFrameworkCore.Query.NavigationBaseIncludeIgnored’: The navigation ‘TaskEntity.Document’ was ignored from ‘Include’ in the query since the fix-up will automatically populate it. If any further navigations are specified in ‘Include’ afterwards then they will be ignored.
To be honest, I don’t understand how to rewrite this correctly to the new standard, please tell me.
var document = await _context.Documents
.Include(t => t.Tasks)
.ThenInclude(t => t.Workplace)
.ThenInclude(t => t.WorkplaceUsers)
.ThenInclude(t => t.User)
.Include(t => t.Tasks)
.ThenInclude(t => t.Document)
.ThenInclude(t => t.ParentDocument)
.Include(t => t.Tasks)
.ThenInclude(t => t.Document)
.ThenInclude(t => t.RouteStepValues)
.Include(t => t.RouteStepValues)
.ThenInclude(t => t.RouteStepValueProperties)
.Include(t => t.RouteStepValues)
.ThenInclude(t => t.Element)
.ThenInclude(t => t.ElementProperties)
.Include(t => t.RouteStepValues)
.ThenInclude(t => t.Document)
.ThenInclude(t => t.DocumentType)
.ThenInclude(t => t.Components)
.ThenInclude(t => t.ComponentProperties)
.Include(t => t.RouteStepValues)
.ThenInclude(t => t.Document)
.ThenInclude(t => t.DocumentType)
.ThenInclude(t => t.Components)
.ThenInclude(t => t.ComponentElements)
.ThenInclude(t => t.Element)
.ThenInclude(t => t.ElementProperties)
.Include(t => t.RouteStepValues)
.ThenInclude(t => t.Document)
.ThenInclude(t => t.DocumentAttributes)
.Include(t => t.RouteStepValues)
.ThenInclude(t => t.Document)
.ThenInclude(t => t.CardFieldValues)
.ThenInclude(t => t.Element)
.ThenInclude(t => t.ElementPropertyDependencies)
.ThenInclude(t => t.ElementProperty)
.Include(t => t.RouteStepValues)
.ThenInclude(t => t.Document)
.ThenInclude(t => t.ParentDocument)
.ThenInclude(t => t.CardFieldValues)
.ThenInclude(t => t.Element)
.ThenInclude(t => t.ElementPropertyDependencies)
.ThenInclude(t => t.ElementProperty)
.AsSplitQuery()
.FirstOrDefaultAsync(t => t.Id == request.DocumentId);