public ActionResult Cadastro() { ViewBag.Clientes = ClienteApplication.GetAll(); ViewBag.Produtos = ProdutoApplication.GetAll(); return(View(new PedidoDTO())); }
public ActionResult Index() { try { return(View(Application.GetAll())); } catch (Exception exc) { ViewBag.Message = exc.Message; return(View(new List <ClienteDTO>())); } }
public ActionResult <IEnumerable <Cliente> > GetAll() { Stopwatch sw = new Stopwatch(); sw.Start(); var clienteViewModel = _clienteApplication.GetAll(); if (clienteViewModel == null) { return(NoContent()); } sw.Stop(); return(Ok(new { success = true, data = clienteViewModel, tempoProcessamento = $"{TimeSpan.FromMilliseconds(sw.ElapsedMilliseconds).Seconds} segundos e " + $"{TimeSpan.FromMilliseconds(sw.ElapsedMilliseconds).Milliseconds} milessegundos" })); }
public IEnumerable <Cliente> Get([FromServices] IClienteApplication clienteApplication) { return(clienteApplication.GetAll()); }