private async Task OnExceptionAsync(object s, UnhandledExceptionEventArgs e) { var ex = (Exception)e.ExceptionObject; var error = new Error(ex); using (var db = new LogDatabase()) { await db.Errors.AddAsync(error); await db.SaveChangesAsync(); } }
public static Task EnsureExistsAsync() { using (var db = new LogDatabase()) return(db.Database.EnsureCreatedAsync()); }