summaryrefslogtreecommitdiff
path: root/Project-Unite
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-04-04 19:48:14 -0400
committerMichael <[email protected]>2017-04-04 19:48:14 -0400
commit6a9ce408d8ed641b6237026e833a286a2a6d3326 (patch)
tree16e00378c0871471762b8d1f67f0145b5e7cc75d /Project-Unite
parentad575bcd38a3ea8dc0fe552f69f085c05da770e8 (diff)
downloadproject-unite-6a9ce408d8ed641b6237026e833a286a2a6d3326.tar.gz
project-unite-6a9ce408d8ed641b6237026e833a286a2a6d3326.tar.bz2
project-unite-6a9ce408d8ed641b6237026e833a286a2a6d3326.zip
more asynchrous stuff
Diffstat (limited to 'Project-Unite')
-rw-r--r--Project-Unite/App_Start/IdentityConfig.cs8
1 files changed, 4 insertions, 4 deletions
diff --git a/Project-Unite/App_Start/IdentityConfig.cs b/Project-Unite/App_Start/IdentityConfig.cs
index 66a80bb..a767b43 100644
--- a/Project-Unite/App_Start/IdentityConfig.cs
+++ b/Project-Unite/App_Start/IdentityConfig.cs
@@ -18,7 +18,7 @@ namespace Project_Unite
{
public class EmailService : IIdentityMessageService
{
- public Task SendAsync(IdentityMessage message)
+ public async Task SendAsync(IdentityMessage message)
{
try
{
@@ -41,7 +41,7 @@ namespace Project_Unite
var db = new ApplicationDbContext();
db.AuditLogs.Add(new AuditLog("system", AuditLogLevel.Admin, $"Email sending...<br/><br/><strong>To:</strong> {sMsg.To}<br/><strong>Subject:</strong><br/>{sMsg.Subject}"));
db.SaveChanges();
- smtp.SendCompleted += (o, a) =>
+ smtp.SendCompleted += async (o, a) =>
{
var alog = new AuditLog("system", AuditLogLevel.Admin, "");
if (a.Cancelled == true)
@@ -52,7 +52,7 @@ namespace Project_Unite
alog.Description += $"Error:<br/><pre><code class=\"language-csharp\">{a.Error}</code></pre>";
var ndb = new ApplicationDbContext();
ndb.AuditLogs.Add(alog);
- ndb.SaveChanges();
+ await ndb.SaveChangesAsync();
};
smtp.SendAsync(sMsg, null);
}
@@ -64,7 +64,7 @@ namespace Project_Unite
{ex}"));
db.SaveChanges();
}
- return Task.FromResult(0);
+ return;
}