public async Task <bool> Commit() { if (_mediatorService.HasNotifications()) { return(false); } try { await _dbContext.SaveChangesAsync(); return(true); } catch (Exception e) { await _mediatorService.SendNotification(new DomainNotification("Erro ao processar requisição", e.Message)); return(false); } }
protected bool HasNotifications() => !_mediatorService.HasNotifications();