Skip to content

Instantly share code, notes, and snippets.

@abhishekluv
Created March 30, 2026 06:13
Show Gist options
  • Select an option

  • Save abhishekluv/2c0a1c1e54d2672e785d8f5cbc5e48b3 to your computer and use it in GitHub Desktop.

Select an option

Save abhishekluv/2c0a1c1e54d2672e785d8f5cbc5e48b3 to your computer and use it in GitHub Desktop.
DemoCode
var instances = await context.Instances
.Where(i =>
i.SubjectUuid == subjectUuid &&
i.VersionUuid == versionUuid)
.Select(i => new
{
Instance = i,
HasSubmissions = i.Submissions.Any() // using Any() to check if any submissions are there or not
})
.AsSplitQuery()
.ToListAsync();
foreach (var item in instances)
{
UpdateInstancesWithEndDate(
item.Instance,
item.HasSubmissions
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment