Example #1
0
        public async Task <IActionResult> PutKlopapier(int id, Klopapier klopapier)
        {
            if (id != klopapier.Id)
            {
                return(BadRequest());
            }

            _context.Entry(klopapier).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!KlopapierExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        public async Task <IActionResult> PutGames(int id, Games games)
        {
            if (id != games.Id)
            {
                return(BadRequest());
            }

            _context.Entry(games).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!GamesExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Example #3
0
        public async Task <IActionResult> Create([Bind("Id,AnzahlBlatt,Hersteller,Produkt,Langen,Duft")] Klopapier klopapier)
        {
            if (ModelState.IsValid)
            {
                _context.Add(klopapier);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(klopapier));
        }
        public async Task <IActionResult> Create([Bind("Id,Hersteller,Vertieb,Genre,Titel,Preis,Veröffentlicht,Beschreibung")] Games games)
        {
            if (ModelState.IsValid)
            {
                _context.Add(games);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(games));
        }