public async Task <IActionResult> PutMapCompanyDocument([FromRoute] int id, [FromBody] MapCompanyDocument mapCompanyDocument) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != mapCompanyDocument.CompDocId) { return(BadRequest()); } _context.Entry(mapCompanyDocument).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MapCompanyDocumentExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PostMapCompanyDocument([FromBody] MapCompanyDocument mapCompanyDocument) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.MapCompanyDocument.Add(mapCompanyDocument); await _context.SaveChangesAsync(); return(CreatedAtAction("GetMapCompanyDocument", new { id = mapCompanyDocument.CompDocId }, mapCompanyDocument)); }