Пример #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());
 }