public async Task <IActionResult> PutBolgeLider([FromRoute] int id, [FromBody] BolgeLider bolgeLider) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != bolgeLider.Id) { return(BadRequest()); } _context.Entry(bolgeLider).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BolgeLiderExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PostBolgeLider([FromBody] BolgeLider bolgeLider) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.BolgeLider.Add(bolgeLider); await _context.SaveChangesAsync(); return(CreatedAtAction("GetBolgeLider", new { id = bolgeLider.Id }, bolgeLider)); }