public async Task <ActionResult <BotsTable> > PostBotTable(BotsTable botTable) { _context.BotsTables.Add(botTable); await _context.SaveChangesAsync(); return(CreatedAtAction("GetBotTable", new { id = botTable.BotId }, botTable)); }
public async Task <IActionResult> PutBotTable(int id, BotsTable botTable) { if (id != botTable.BotId) { return(BadRequest()); } _context.Entry(botTable).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BotTableExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }