Skip to content

Instantly share code, notes, and snippets.

@kendallmiller
Created July 17, 2013 19:40
Show Gist options
  • Select an option

  • Save kendallmiller/6023770 to your computer and use it in GitHub Desktop.

Select an option

Save kendallmiller/6023770 to your computer and use it in GitHub Desktop.
Query with no tracking
Guid[] logEventIds;
using (IDbContext ctx = repository.GetContext())
{
// find all session events that have changed since we last processed
logEventIds = ctx.Set<LogEvent>().AsNoTracking()
.OrderBy(e => e.LastOccurrence.Date)
.Select(e => e.Id)
.ToArray();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment