public async Task ChangeOrderStatus(int id, string status) { await Task.Factory.StartNew(() => { OrderStatus statusE = OrderStatus.Pending; switch (status) { case "Pending": statusE = OrderStatus.Pending; break; case "Complete": statusE = OrderStatus.Complete; break; case "Cancelled": statusE = OrderStatus.Cancelled; break; case "Processing": statusE = OrderStatus.Processing; break; } client.ChangeOrderStatus(id, statusE); }).ConfigureAwait(false); }