Esempio n. 1
0
 public async Task <int> SaveAsync(CancellationToken cancellationToken = default(CancellationToken))
 {
     try
     {
         return(await(_context.ChangeTracker.HasChanges() ? _context.SaveChangesAsync(cancellationToken) : Task.FromResult(0)));
     }
     catch (Exception ex)
     {
         LogProvider.Error($"Failed saving changes async from unity of work: {ex.Message}. Detailes: {ex}");
         return(await Task.FromResult(0));
     }
 }
Esempio n. 2
0
        public async Task <int> SaveAsync(CancellationToken cancellationToken = default(CancellationToken))
        {
            await _context.SaveChangesAsync();

            return(1);
        }