Beispiel #1
0
        public async Task <IActionResult> PutKommentar(int id, Kommentar kommentar)
        {
            if (id != kommentar.KommentarId)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
        public async Task <IActionResult> PutNutzerProjekte(int id, NutzerProjekte nutzerProjekte)
        {
            if (id != nutzerProjekte.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
        public async Task <IActionResult> PutTeilaufgaben(int id, Teilaufgaben teilaufgaben)
        {
            if (id != teilaufgaben.TeilaufgabenId)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }