Skip to content

Instantly share code, notes, and snippets.

@jernejk
Created March 7, 2020 14:20
Show Gist options
  • Save jernejk/daa488d7055e43d8cd1c9bde99526d38 to your computer and use it in GitHub Desktop.
Save jernejk/daa488d7055e43d8cd1c9bde99526d38 to your computer and use it in GitHub Desktop.
public async Task<IEnumerable<Tweet>> GetTweetsWithExtraLogs(CancellationToken ct = default)
{
using (_logger.BeginScope(new Dictionary<string, object> { { "EFQueries", "GetTweetsLog" } }))
{
return await _context.Tweets
.TagWith("GetTweets + LogContext")
.ToListAsync(ct)
.ConfigureAwait(false);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment