public async Task <ActionResult> AsyncWithTaskCalculate(CalculationLogModel model)
        {
            var threadId = Thread.CurrentThread.ManagedThreadId;
            var x        = model.Number;

            var log = await _service.AsyncWithTaskCalculate(x);

            return(View("Index", new CalculationLogModel(log, model.Number, "Asynchronous calculation with tasks", threadId)));
        }
Example #2
0
        private async void AsyncWithTaskButton_Click(object sender, EventArgs e)
        {
            var n = ++_count;

            LogStart(AsyncWithTaskButton.Text, n);

            var log = await _service.AsyncWithTaskCalculate(Convert.ToInt32(NumberTextBox.Text));

            LogEnd(AsyncWithTaskButton.Text, log, n);
        }