コード例 #1
0
        public async Task <ActionResult> Index()
        {
            User user = new User();

            user.Username = "******";
            user.Name     = "Dylan Steele";

            await _pipeline.Post(user);

            await _pipeline.Complete();

            await _pipeline.WaitForResultsAsync();

            var users = _pipeline.GetResults().Result;
            await _pipeline.Flush();

            //TestPipeline pipeline = new TestPipeline();
            //pipeline.Post(user);
            //pipeline.InputBlock.Complete();
            //await pipeline.CompletionTask;
            //var t = pipeline.Result;
            //List<User> test = new List<User>();
            //test.Add(user);
            ViewBag.Users = users;

            //TimingTest timingTest = new TimingTest();

            //GenerateOrder randomOrder = new GenerateOrder(OrderType.CarLoan);

            //_pipelineService.FillPipeline(randomOrder.order);
            //_pipelineService.FillPipeline(new GenerateOrder(OrderType.HomeLoan).order);
            //_pipelineService.FillPipeline(new GenerateOrder(OrderType.OtherLoan).order);
            //_pipelineService.FillPipeline(new GenerateOrder(OrderType.PersonalLoan).order);
            //_pipelineService.FillPipeline(new GenerateOrder(OrderType.CarLoan).order);

            //_pipelineService.WaitForResults();

            //var test = _pipelineService.GetResults().Result;
            ////Flush the results of the pipeline after receiving them
            //_pipelineService.FlushPipeline();
            //List<Order> receivedOrders = new List<Order>();
            //foreach (object inputOrder in test)
            //{
            //    var order = (Order)inputOrder;
            //    if (!string.IsNullOrEmpty(order.ClientFName))
            //    {
            //        receivedOrders.Add((Order)inputOrder);
            //    }
            //}
            //ViewBag.Orders = receivedOrders;

            return(View());
        }