Last active
March 7, 2020 14:19
-
-
Save jernejk/5d473f9c2fb2a1b6ae71d73175930735 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public async Task InsertTweet(string username, string message, CancellationToken ct = default) | |
{ | |
using (_logger.BeginScope(new Dictionary<string, object> { { "EFQueries", "InsertTweet" } })) | |
{ | |
_context.Tweets.Add(new Tweet | |
{ | |
Username = username, | |
Message = message, | |
CreatedUtc = DateTime.UtcNow | |
}); | |
await _context.SaveChangesAsync(ct); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment