Пример #1
0
 public override Task <int> SaveChangesAsync(CancellationToken cancellationToken = default)
 {
     try
     {
         var res = base.SaveChangesAsync(cancellationToken);
         SaveChangesResult = new SaveChangesResult
         {
             Exception = null
         };
         return(res);
     }
     catch (Exception ex)
     {
         SaveChangesResult = new SaveChangesResult
         {
             Exception = ex
         };
         return(Task.FromResult(-1));
     }
 }
Пример #2
0
 public EreceiptContext(DbContextOptions <EreceiptContext> options) : base(options)
 {
     Database.EnsureCreated();
     SaveChangesResult = new SaveChangesResult();
     //InitBaseDataIfDatabaseEmpty();
 }