public async Task <IActionResult> PutTrabajosefec(int id, Trabajosefec Trabajosefec) { if (id != Trabajosefec.Id) { return(BadRequest()); } _context.Entry(Trabajosefec).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TrabajosefecExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <Trabajosefec> > PostTrabajosefec(Trabajosefec Trabajosefec) { _context.Trabajosefec.Add(Trabajosefec); try { await _context.SaveChangesAsync(); } catch (DbUpdateException) { if (TrabajosefecExists(Trabajosefec.Id)) { return(Conflict()); } else { throw; } } return(CreatedAtAction("GetTrabajosefec", new { id = Trabajosefec.Id }, Trabajosefec)); }