예제 #1
0
        public ActionResult Cadastro()
        {
            ViewBag.Clientes = ClienteApplication.GetAll();
            ViewBag.Produtos = ProdutoApplication.GetAll();

            return(View(new PedidoDTO()));
        }
예제 #2
0
 public ActionResult Index()
 {
     try
     {
         return(View(Application.GetAll()));
     }
     catch (Exception exc)
     {
         ViewBag.Message = exc.Message;
         return(View(new List <ClienteDTO>()));
     }
 }
예제 #3
0
        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"
            }));
        }
예제 #4
0
 public IEnumerable <Cliente> Get([FromServices] IClienteApplication clienteApplication)
 {
     return(clienteApplication.GetAll());
 }