示例#1
0
        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);
            }
        }
示例#2
0
 protected bool HasNotifications() => !_mediatorService.HasNotifications();