public async Task <ActionResult> DeleteConfirmed(int id)
        {
            Games_and_Images games_and_Images = await db.GamesAndImagesSet.FindAsync(id);

            db.GamesAndImagesSet.Remove(games_and_Images);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
Пример #2
0
        public void Games_and_ImagesTest()
        {
            var games_and_images = new Games_and_Images();

            if (games_and_images == null)
            {
                Assert.Fail();
            }
        }
        public async Task <ActionResult> Edit([Bind(Include = "Id,GameId,Link")] Games_and_Images games_and_Images)
        {
            if (ModelState.IsValid)
            {
                db.Entry(games_and_Images).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            ViewBag.GameId = new SelectList(db.Games.OrderBy(g => g.Name), "Id", "Name", games_and_Images.GameId);
            return(View(games_and_Images));
        }
        // GET: Games_and_Images/Details/5
        public async Task <ActionResult> Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Games_and_Images games_and_Images = await db.GamesAndImagesSet.FindAsync(id);

            if (games_and_Images == null)
            {
                return(HttpNotFound());
            }
            return(View(games_and_Images));
        }
        // GET: Games_and_Images/Edit/5
        public async Task <ActionResult> Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Games_and_Images games_and_Images = await db.GamesAndImagesSet.FindAsync(id);

            if (games_and_Images == null)
            {
                return(HttpNotFound());
            }
            ViewBag.GameId = new SelectList(db.Games.OrderBy(g => g.Name), "Id", "Name", games_and_Images.GameId);
            return(View(games_and_Images));
        }