예제 #1
0
        public async Task <IActionResult> Puttutores(int id, tutores tutores)
        {
            if (id != tutores.id_tutor)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
예제 #2
0
        public async Task <ActionResult <tutores> > Posttutores(tutores tutores)
        {
            _context.tutores.Add(tutores);
            await _context.SaveChangesAsync();


            return(CreatedAtAction("Gettutores", new { id = tutores.id_tutor }, tutores));
        }