Exemplo n.º 1
0
        public async Task <ActionResult <Pitest> > PostPitest(Pitest pitest)
        {
            _context.Pitest.Add(pitest);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetPitest", new { id = pitest.PitestId }, pitest));
        }
Exemplo n.º 2
0
 public async Task <IActionResult> PutPitest(int id, Pitest pitest)
 {
     if (id != pitest.PitestId)
     {
         return(BadRequest());
     }
     _context.Entry(pitest).State = EntityState.Modified;
     try
     {
         await _context.SaveChangesAsync();
     }
     catch (DbUpdateConcurrencyException)
     {
         if (!PitestExists(id))
         {
             return(NotFound());
         }
         else
         {
             throw;
         }
     }
     return(NoContent());
 }