public async Task <IActionResult> PatchQuehacer(long id, Quehacer quehacer) { if (id != quehacer.Id) { return(BadRequest()); } _context.Entry(quehacer).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!QuehacerExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <Quehacer> > PostQuehacer(Quehacer quehacer) { _context.Quehaceres.Add(quehacer); await _context.SaveChangesAsync(); //return CreatedAtAction("GetQuehacer", new { id = quehacer.Id }, quehacer); return(CreatedAtAction(nameof(GetQuehacer), new { id = quehacer.Id }, quehacer)); }