// GET: Mascotas/Details/5 public ActionResult Details(Guid?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Mascota mascota = db.Mascotas.Find(id); if (mascota == null) { return(HttpNotFound()); } var model = new MascotaViewModel(); model.LoadModel(mascota); return(View(model)); }
// GET: Mascotas/Edit/5 public ActionResult Edit(Guid?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Mascota mascota = db.Mascotas.Find(id); if (mascota == null) { return(HttpNotFound()); } var model = new MascotaViewModel(); model.LoadModel(mascota); ViewBag.ClienteId = new SelectList(db.Users, "Id", "Nombre", mascota.ClienteId); ViewBag.RazaId = new SelectList(db.Razas, "Id", "Nombre", mascota.RazaId); return(View(model)); }