© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4mo ago•
12 replies
SWEETPONY

✅ How to get data from entity without includes?

I have this:
var shiftTask = await dbContext.Shifts
     .Include(x => x.Resource)
     .Include(x => x.Function)
     .Include(x => x.CancelledByUser)
     .Include(x => x.FinishedByUser)
     .Include(x => x.CurrentLocation)
     .Include(x => x.DefaultLocation)
     .AsNoTracking()
     .AsSplitQuery()
     .FirstOrDefaultAsync(wt => wt.Identity == identity, context.RequestAborted)
     .ConfigureAwait(false);
var shiftTask = await dbContext.Shifts
     .Include(x => x.Resource)
     .Include(x => x.Function)
     .Include(x => x.CancelledByUser)
     .Include(x => x.FinishedByUser)
     .Include(x => x.CurrentLocation)
     .Include(x => x.DefaultLocation)
     .AsNoTracking()
     .AsSplitQuery()
     .FirstOrDefaultAsync(wt => wt.Identity == identity, context.RequestAborted)
     .ConfigureAwait(false);


Is it possible to achive the same but without using a lot of includes?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

✅ How to get all data without Include?
C#CC# / help
2y ago
❔ Get an entity with Sql data client
C#CC# / help
3y ago
❔ how to get city data from request body?
C#CC# / help
3y ago
✅ Typeorm doesnt get the name from entity
C#CC# / help
3y ago