public async Task <IActionResult> PutMapCompanyArea([FromRoute] int id, [FromBody] MapCompanyArea mapCompanyArea) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != mapCompanyArea.CompanyAreaId) { return(BadRequest()); } _context.Entry(mapCompanyArea).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MapCompanyAreaExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PostMapCompanyArea([FromBody] MapCompanyArea mapCompanyArea) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.MapCompanyArea.Add(mapCompanyArea); await _context.SaveChangesAsync(); return(CreatedAtAction("GetMapCompanyArea", new { id = mapCompanyArea.CompanyAreaId }, mapCompanyArea)); }