Example #1
0
        // GET: ClienteController
        public ActionResult Index()
        {
            RepoCliente             repoCliente   = new RepoCliente();
            var                     listaClientes = repoCliente.GetAll();
            List <ClienteViewModel> ListClienteVM = _mapper.Map <List <ClienteViewModel> >(listaClientes);

            return(View(ListClienteVM));
        }
Example #2
0
        // GET: PedidoController/Create
        public IActionResult AltaPedido()
        {
            var repoCliente = new RepoCliente();
            var repoCadete  = new RepoCadetes();

            var PedidoViewModel = new PedidoViewModel
            {
                listadoDeCadetes  = _mapper.Map <List <CadeteViewModel> >(repoCadete.GetAll()),
                listadoDeClientes = _mapper.Map <List <ClienteViewModel> >(repoCliente.GetAll())
            };

            return(View(PedidoViewModel));
        }