public ActionResult ShowToFactura() { //var objCart = new ShoppingCart(); //string cartCurrent = objCart.GetCartId(this.HttpContext); //// obtengo los datos de factura q se han guardado //var listElementsFactura = db.facturas.Where(f => f.IdentificatedFactura == cartCurrent); //return View(listElementsFactura); string textError = null; var car = new ShoppingCart(); try { if (car.ShowFactura() == null) { ViewBag.error = "si es null"; } else { ViewBag.error = "no es null es => " + car.ShowFactura(); } }catch(Exception er){ textError = er.ToString(); } ViewBag.error = textError; return View(car.ShowFactura()); }