public async Task<ActionResult<KalaPicture>> PostKalaPicture(KalaPicture kalaPicture) { _IKalaPicture.Add(kalaPicture); await _IKalaPicture.SaveAsync(); return CreatedAtAction("GetKalaPicture", new { id = kalaPicture.KalaPictureId }, kalaPicture); }
public async Task<IActionResult> PutKalaPicture(int id, KalaPicture kalaPicture) { if (id != kalaPicture.KalaPictureId) { return BadRequest(); } _IKalaPicture.Update(kalaPicture); try { await _IKalaPicture.SaveAsync(); } catch (DbUpdateConcurrencyException) { if (!KalaPictureExists(id)) { return NotFound(); } else { throw; } } return NoContent(); }