public async Task <IActionResult> PutTrackerSystems(int id, TrackerSystems trackerSystems) { if (id != trackerSystems.SysId) { return(BadRequest()); } _context.Entry(trackerSystems).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TrackerSystemsExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <TrackerSystems> > PostTrackerSystems(TrackerSystems trackerSystems) { if (ModelState.IsValid) { if (_context.TrackerSystems.Any(x => x.SysName == trackerSystems.SysName)) { return(Conflict("System name already exsists")); } else { _context.TrackerSystems.Add(trackerSystems); await _context.SaveChangesAsync(); } } return(CreatedAtAction("GetTrackerSystems", new { id = trackerSystems.SysId }, trackerSystems)); }