コード例 #1
0
        public async Task <IActionResult> PutLecAndStudent(int id, LecAndStudent lecAndStudent)
        {
            if (id != lecAndStudent.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
コード例 #2
0
        public async Task <IActionResult> PutAca(int id, Aca aca)
        {
            if (id != aca.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
コード例 #3
0
 public void Put([FromBody] Student value)
 {
     _context.Entry(value).State = EntityState.Added;
     _context.SaveChanges();
 }