public async Task <IActionResult> PutMKV(string id, MKV mKV) { if (id != mKV.Key) { return(BadRequest()); } _context.Entry(mKV).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MKVExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <MKV> > PostMKV(MKV mKV) { _context.SKV.Add(mKV); await _context.SaveChangesAsync(); return(CreatedAtAction("GetMKV", new { id = mKV.Key }, mKV)); }
public async Task <ActionResult <MKV> > PostMKV(MKV mKV) { if (_context.SKV.Find(mKV.Key) != null) { return(Forbid()); } _context.SKV.Add(mKV); await _context.SaveChangesAsync(); return(CreatedAtAction("GetMKV", new { id = mKV.Key }, mKV)); }