Beispiel #1
0
        public async Task <ActionResult <InstLevelStudy> > PostInstLevelStudy(InstLevelStudy instLevelStudy)
        {
            _context.InstLevelStudy.Add(instLevelStudy);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetInstLevelStudy", new { id = instLevelStudy.Id }, instLevelStudy));
        }
Beispiel #2
0
        public async Task <IActionResult> PutInstLevelStudy(int id, InstLevelStudy instLevelStudy)
        {
            if (id != instLevelStudy.Id)
            {
                return(BadRequest());
            }

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

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

            return(Ok(instLevelStudy));
        }