public async Task <IActionResult> PutMapSettingsRole([FromRoute] int id, [FromBody] MapSettingsRole mapSettingsRole) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != mapSettingsRole.Srid) { return(BadRequest()); } _context.Entry(mapSettingsRole).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MapSettingsRoleExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PostMapSettingsRole([FromBody] MapSettingsRole mapSettingsRole) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.MapSettingsRole.Add(mapSettingsRole); await _context.SaveChangesAsync(); return(CreatedAtAction("GetMapSettingsRole", new { id = mapSettingsRole.Srid }, mapSettingsRole)); }