public async Task <ActionResult <Techshot> > PostTechshot(Techshot techshot) { _context.Techshots.Add(techshot); await _context.SaveChangesAsync(); return(CreatedAtAction("GetTechshot", new { id = techshot.TechshotId }, techshot)); }
public async Task <IActionResult> PutTechshot(int id, Techshot techshot) { if (id != techshot.TechshotId) { return(BadRequest()); } _context.Entry(techshot).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TechshotExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }