public async Task <CompletationOrder> AddOrderAsync(CompletationOrder order) { Source.Add(order); var original = await find(order.id); return(order); }
public async Task <CompletationOrder> UpdateOrderAsync(CompletationOrder order, int id) { var original = await find(order.id); Source.Remove(original); return(order); }
public async void Post([FromBody] CompletationOrder value) { if (value != null) { var order = await _ordersService.AddOrderAsync(value); await _context.Clients.All.SendAsync("Add", order); } }
public async Task <IActionResult> Put(int id, [FromBody] CompletationOrder value) { try { var updated = await _ordersService.UpdateOrderAsync(value, id); await _context.Clients.All.SendAsync("Update", updated); } catch (Exception) { // TODO use exception to get more readable return codes return(NotFound()); } return(NoContent()); }
public async Task Delete(CompletationOrder value) => await Clients.All.Delete(value);
public async Task Update(CompletationOrder value) => await Clients.All.Update(value);
public async Task Add(CompletationOrder value) => await Clients.All.Add(value);