public async Task <IViewComponentResult> InvokeAsync()
        {
            var notificacoes = await Task.FromResult(_notificator.ObterNotificacoes());

            notificacoes.ForEach(n => ViewData.ModelState.AddModelError(string.Empty, n.Mensagem));

            return(View());
        }
Example #2
0
        protected async new Task <IActionResult> Response(object result = null)
        {
            if (IsValidOperation())
            {
                return(Ok(result));
            }

            return(BadRequest(new
            {
                success = false,
                errors = await Task.Run(() => _notifications.ObterNotificacoes().Select(n => n.Mensagem))
            }));
        }