public async Task <ActionResult <DetectedPlate> > PostDetectedPlate(DetectedPlate detectedPlate) { _context.Plates.Add(detectedPlate); await _context.SaveChangesAsync(); return(CreatedAtAction("GetDetectedPlate", new { id = detectedPlate.DetectedPlateId }, detectedPlate)); }
public async Task <IActionResult> PutDetectedPlate(Guid id, DetectedPlate detectedPlate) { if (id != detectedPlate.DetectedPlateId) { return(BadRequest()); } _context.Entry(detectedPlate).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DetectedPlateExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }