public ActionResult Create(Rating collection) { try { // TODO: Add insert logic here db.Rating.Add(collection); db.SaveChanges(); return RedirectToAction("Index"); } catch { return View(); } }
public ActionResult Delete(int id, Rating collection) { try { // TODO: Add delete logic here Rating obj = db.Rating.FirstOrDefault(x => x.RatingId == id); db.Rating.Remove(obj); db.SaveChanges(); return RedirectToAction("Index"); } catch { return View(); } }