public async Task <IActionResult> PostZetronTrnDroneLocations([FromBody] ZetronTrnDroneLocations zetronTrnDroneLocations) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.ZetronTrnDroneLocations.Add(zetronTrnDroneLocations); await _context.SaveChangesAsync(); return(CreatedAtAction("GetZetronTrnDroneLocations", new { id = zetronTrnDroneLocations.LocationID }, zetronTrnDroneLocations)); }
public async Task <IActionResult> PutZetronTrnDroneLocations([FromRoute] int id, [FromBody] ZetronTrnDroneLocations zetronTrnDroneLocations) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != zetronTrnDroneLocations.LocationID) { return(BadRequest()); } _context.Entry(zetronTrnDroneLocations).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ZetronTrnDroneLocationsExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }