public void SendOrder(int orderId) { // Wait 5 sec and then tell user order is complete Task.Run(() => { // Record order in DB CosmosDbHelper.AddOrderData(orderId, Context.ConnectionId); Thread.Sleep(5000); Clients.Caller.broadcastMessage("System", "Order " + orderId + " is complete."); }); }
protected void Application_Start(object sender, EventArgs e) { // This creates the DB and collection in cosmosdb // Normally you would do this ahead of time CosmosDbHelper.Init(); }