示例#1
0
        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();
            }
        }
示例#2
0
 public static Task EnsureExistsAsync()
 {
     using (var db = new LogDatabase())
         return(db.Database.EnsureCreatedAsync());
 }