public ActionResult Nuevo(Articulos articulos) { var category = _contex.categorias.ToList(); var viewmodel = new ArtiulosModelView { Articulos = new Articulos(), categorias = category }; return(View("Nuevo", viewmodel)); }
public ActionResult Edit(int?id) { var articulos = _contex.articulos.SingleOrDefault(c => c.Id == id); if (articulos == null) { return(HttpNotFound()); } var viewmodel = new ArtiulosModelView { Articulos = articulos, categorias = _contex.categorias.ToList() }; return(View(viewmodel)); }