Ejemplo n.º 1
0
        public ActionResult UpdateAnimal(int id)
        {
            var      result = db.Animal.FirstOrDefault(x => x.ID == id);
            AnimalVM animal = new AnimalVM();

            animal.Name         = result.Name;
            animal.ID           = result.ID;
            animal.Age          = result.Age;
            animal.Color        = result.Color;
            animal.Location     = result.Location;
            animal.GenusName    = AnimalRepo.AnimalGenusName(result.GenusId);
            animal.CategoryName = AnimalRepo.AnimalCategoryName(result.CategoryId);
            return(View(animal));
        }