Skip to content

Instantly share code, notes, and snippets.

@jernejk
Last active March 7, 2020 13:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jernejk/642a87dadc975685293ea764988ca06c to your computer and use it in GitHub Desktop.
Save jernejk/642a87dadc975685293ea764988ca06c to your computer and use it in GitHub Desktop.
using (_logger.BeginScope(new Dictionary<string, object> { { "EFQueries", "GetTweets" } }))
{
var tweets = await _twitterService.GetTweets(ct);
}
// Same query as before.
public async Task<IEnumerable<Tweet>> GetTweets(CancellationToken ct = default)
{
return await _context.Tweets
.ToListAsync(ct)
.ConfigureAwait(false);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment