protected void PushCommandToRest(string transferObject) { var commandLineClient = new MonitorClient(AuspiciousCache.AuspiciousIp, AuspiciousCache.AuspiciousPort); commandLineClient.SendDataToRest(Guid.NewGuid(), (int)CommandType, RestaurantId, transferObject); commandLineClient.ResultResponse += CommandLineClient_ResultResponse; int index = 0; while (index < 15 && Code == 1) { index++; Thread.Sleep(200); } }