# System.InvalidOperationException: Cannot use split query for a query that uses Include on a collection navigation that is also used in a Select. Either call AsSplitQuery() before the Include or remove the Select.

- **ID:** `dotnet/ef-core-query-split-query-exception`
- **Domain:** dotnet
- **Category:** data_error
- **Verification:** ai_generated
- **Fix Rate:** 90%

## Root Cause

Entity Framework Core throws this when a LINQ query combines 'Include' on a navigation property with a 'Select' that projects the same navigation, conflicting with split query execution mode.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| Entity Framework Core 7.0 | active | — | — |
| Entity Framework Core 8.0 | active | — | — |

## Workarounds

1. **Place 'AsSplitQuery()' before the first 'Include' in the query chain: 'var result = context.Orders.AsSplitQuery().Include(o => o.Items).Where(o => o.Id == 1).ToList();'** (90% success)
   ```
   Place 'AsSplitQuery()' before the first 'Include' in the query chain: 'var result = context.Orders.AsSplitQuery().Include(o => o.Items).Where(o => o.Id == 1).ToList();'
   ```
2. **Replace 'Include' with a 'Select' that explicitly projects the related data: 'var result = context.Orders.Where(o => o.Id == 1).Select(o => new { o.Id, Items = o.Items.Select(i => i.Name) }).ToList();'** (85% success)
   ```
   Replace 'Include' with a 'Select' that explicitly projects the related data: 'var result = context.Orders.Where(o => o.Id == 1).Select(o => new { o.Id, Items = o.Items.Select(i => i.Name) }).ToList();'
   ```

## Dead Ends

- **** — Adding 'AsSplitQuery()' after 'Include' does not fix the issue; it must be placed before the Include chain. (80% fail)
- **** — Removing 'Include' and relying solely on lazy loading may cause N+1 query problems and performance degradation. (65% fail)
- **** — Switching to 'AsSingleQuery()' globally avoids the error but may cause cartesian explosion and slow queries. (70% fail)
