public List<productos> Listar() { var productos = new List<productos>(); try { using (var context = new BD_ProyectoGavilanchContext { }) { productos = context.productos.ToList(); } } catch (Exception e) { throw new Exception(e.Message); } return productos; }
public List <peliculas> ListarPeliculas() { var peliculas = new List <peliculas>(); try { using (var context = new BD_ProyectoGavilanchContext { }) { peliculas = context.Peliculas.ToList(); } } catch (Exception e) { throw new Exception(e.Message); } return(peliculas); }