public async Task <ActionResult> ProcessRequest(RequestModel model) { model.AssignNumbersToRules(); var nodesResult = await _nodesService.GetAllNodes(); if (!nodesResult.isSuccessful) { ModelState.AddModelError("", nodesResult.ToStringErrors()); return(View(model)); } var nodes = nodesResult.result; model.Nodes = nodes; var rules = string.Join(System.Environment.NewLine, nodes.Select(x => x.Rule.ToStringFull()).ToList()); foreach (var rule in model.Rules) { if (!rules.Contains(rule.ToStringFull())) { return(PartialView("~/Views/Shared/Error.cshtml", new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier })); } } HttpRequestResult <ResponseModel> result; if (model.MethodType.ToLower() == "backward") { result = await _bcfcService.BackwardTrackAsync(model); } else { result = await _bcfcService.ForwardTrackAsync(model); } if (result.isSuccessful) { var resObj = result.result; if (resObj.MethodType.ToLower() == "forward") { resObj.GenerateIterationsFromTrace(); } resObj.OrderNodesByProduction(); return(PartialView("_ResultPartialView", resObj)); } else { return(PartialView("~/Views/Shared/Error.cshtml", new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier })); } }