public async Task <ActionResult <UndFormVersion> > PostUndFormVersion(UndFormVersion undFormVersion) { _context.UndFormVersion.Add(undFormVersion); await _context.SaveChangesAsync(); return(CreatedAtAction("GetUndFormVersion", new { id = undFormVersion.FormVersionId }, undFormVersion)); }
public async Task <IActionResult> PutUndFormVersion(int id, UndFormVersion undFormVersion) { if (id != undFormVersion.FormVersionId) { return(BadRequest()); } _context.Entry(undFormVersion).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UndFormVersionExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }