Ejemplo n.º 1
0
 public ActionResult TodosLivros()
 {
     if (LstLivros != null && LstLivros.Any())
     {
         return(View(LstLivros));
     }
     LstLivros = new List <Livro>();
     LstLivros = _repLivro.PreencherLivros();
     return(View(LstLivros));
 }
Ejemplo n.º 2
0
        public ActionResult LojaLivros()
        {
            if (LstCarrinho == null)
            {
                LstCarrinho = new List <CarrinhoDeCompra>();
            }
            var lstLivros = (List <Livro>)Session["LstLivros"];

            if (lstLivros == null || !lstLivros.Any())
            {
                lstLivros            = _repLivro.PreencherLivros();
                Session["LstLivros"] = lstLivros;
            }
            return(View(lstLivros));
        }