public async Task <ActionResult> DeleteConfirmed(int id) { Ratings ratings = await db.Ratings.FindAsync(id); db.Ratings.Remove(ratings); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public async Task <ActionResult> Edit([Bind(Include = "Id,Name,Description")] Ratings ratings) { if (ModelState.IsValid) { db.Entry(ratings).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(ratings)); }
public async Task <ActionResult> Create([Bind(Include = "Id,Name,Description")] Ratings ratings) { if (ModelState.IsValid) { db.Ratings.Add(ratings); await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(ratings)); }
// GET: Ratings/Delete/5 public async Task <ActionResult> Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Ratings ratings = await db.Ratings.FindAsync(id); if (ratings == null) { return(HttpNotFound()); } return(View(ratings)); }