public async Task <IActionResult> PostSlotTokenSellOrder([FromBody] SlotTokenSellOrder slotTokenSellOrder) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.SlotTokenSellOrder.Add(slotTokenSellOrder); try { await _context.SaveChangesAsync(); } catch (DbUpdateException) { if (SlotTokenSellOrderExists(slotTokenSellOrder.SlotTokenSellOrderId)) { return(new StatusCodeResult(StatusCodes.Status409Conflict)); } else { throw; } } return(CreatedAtAction("GetSlotTokenSellOrder", new { id = slotTokenSellOrder.SlotTokenSellOrderId }, slotTokenSellOrder)); }
public async Task <IActionResult> PutSlotTokenSellOrder([FromRoute] long id, [FromBody] SlotTokenSellOrder slotTokenSellOrder) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != slotTokenSellOrder.SlotTokenSellOrderId) { return(BadRequest()); } _context.Entry(slotTokenSellOrder).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SlotTokenSellOrderExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }