public async Task <IActionResult> PutMapCompanyAuditLog([FromRoute] int id, [FromBody] MapCompanyAuditLog mapCompanyAuditLog) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != mapCompanyAuditLog.AuditLogId) { return(BadRequest()); } _context.Entry(mapCompanyAuditLog).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MapCompanyAuditLogExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PostMapCompanyAuditLog([FromBody] MapCompanyAuditLog mapCompanyAuditLog) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.MapCompanyAuditLog.Add(mapCompanyAuditLog); await _context.SaveChangesAsync(); return(CreatedAtAction("GetMapCompanyAuditLog", new { id = mapCompanyAuditLog.AuditLogId }, mapCompanyAuditLog)); }