Пример #1
0
        public async Task PutLectureship(Guid id, Lectureship Lectureship)
        {
            if (id != Lectureship.Id)
            {
                return;
            }

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

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

            return;
        }
Пример #2
0
        public async Task <ActionResult <Lectureship> > PostLectureship(Lectureship lectureship)
        {
            _context.Lectureship.Add(lectureship);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetLectureship", new { id = lectureship.Id }, lectureship));
        }
Пример #3
0
        public async Task <Lectureship> PostLectureship(Lectureship Lectureship)
        {
            _context.Lectureship.Add(Lectureship);
            await _context.SaveChangesAsync();

            return(Lectureship);
        }
Пример #4
0
        public async Task <IActionResult> PutLectureship(Guid id, Lectureship lectureship)
        {
            if (id != lectureship.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }