I'm writing a C# application that utilizes EF Core to generate all my relationships to my db. I'm currently trying to load some relationships only when I need them (which in this case is when I'm trying to delete records).
I'm trying to use Context.Entry in order to load the relationships required only when I need them, see below:
await Context.Entry(entity).Collection(e => e.DBTable1).LoadAsync();
await Context.Entry(entity).Collection(e => e.DBTable2).LoadAsync();
What I'm curious about is if you can combine multiple relationships into a single load statement, something like below:
await Context.Entry(entity).Collection(e => e.DBTable1 && e => e.DBTable2).LoadAsync();
I know I can use .Include/.ThenInclude to build the relationships before i execute the EF query, however, my workflow requires that the relationships be loaded after the query has been executed.