public ActionResult DeleteConfirmed(int id, string aversion)
        {
            SpeciesAversion speciesAversion = db.SpeciesAversions
                                              .SingleOrDefault(x => x.SpeciesId == id && x.Aversion == aversion);

            db.SpeciesAversions.Remove(speciesAversion);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "SpeciesId,Aversion,Amount,Tag")] SpeciesAversion speciesAversion)
 {
     if (ModelState.IsValid)
     {
         db.Entry(speciesAversion).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.SpeciesId = new SelectList(db.Species, "Id", "Name", speciesAversion.SpeciesId);
     return(View(speciesAversion));
 }
        // GET: SpeciesAversions/Details/5
        public ActionResult Details(int?id, string aversion)
        {
            if (id == null || aversion == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            SpeciesAversion speciesAversion = db.SpeciesAversions
                                              .SingleOrDefault(x => x.SpeciesId == id && x.Aversion == aversion);

            if (speciesAversion == null)
            {
                return(HttpNotFound());
            }
            return(View(speciesAversion));
        }
        // GET: SpeciesAversions/Edit/5
        public ActionResult Edit(int?id, string aversion)
        {
            if (id == null || aversion == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            SpeciesAversion speciesAversion = db.SpeciesAversions
                                              .SingleOrDefault(x => x.SpeciesId == id && x.Aversion == aversion);

            if (speciesAversion == null)
            {
                return(HttpNotFound());
            }
            ViewBag.SpeciesId = new SelectList(db.Species, "Id", "Name", speciesAversion.SpeciesId);
            return(View(speciesAversion));
        }