public async Task <ActionResult> DeleteConfirmed(int id) { Games_and_Genres games_and_Genres = await db.GamesAndGenresSet.FindAsync(id); db.GamesAndGenresSet.Remove(games_and_Genres); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public void Games_and_GenresTest() { var games_and_genres = new Games_and_Genres(); if (games_and_genres == null) { Assert.Fail(); } }
public async Task <ActionResult> Edit([Bind(Include = "Id,GameId,GenreId")] Games_and_Genres games_and_Genres) { if (ModelState.IsValid) { db.Entry(games_and_Genres).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewBag.GameId = new SelectList(db.Games.OrderBy(g => g.Name), "Id", "Name", games_and_Genres.GameId); ViewBag.GenreId = new SelectList(db.Genres.OrderBy(g => g.Name), "Id", "Name", games_and_Genres.GenreId); return(View(games_and_Genres)); }
// GET: Games_and_Genres/Details/5 public async Task <ActionResult> Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Games_and_Genres games_and_Genres = await db.GamesAndGenresSet.FindAsync(id); if (games_and_Genres == null) { return(HttpNotFound()); } return(View(games_and_Genres)); }
// GET: Games_and_Genres/Edit/5 public async Task <ActionResult> Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Games_and_Genres games_and_Genres = await db.GamesAndGenresSet.FindAsync(id); if (games_and_Genres == null) { return(HttpNotFound()); } ViewBag.GameId = new SelectList(db.Games.OrderBy(g => g.Name), "Id", "Name", games_and_Genres.GameId); ViewBag.GenreId = new SelectList(db.Genres.OrderBy(g => g.Name), "Id", "Name", games_and_Genres.GenreId); return(View(games_and_Genres)); }