Exemplo n.º 1
0
        public ActionResult Analysis(SeoAnalyserMainModel model)
        {
            if (ModelState.IsValid)
            {
                bool isUrL = _validateService.ValidUrl(model.InputViewModel.Input);

                if (isUrL)
                {
                    if (!_validateService.ValidateWebsite(model.InputViewModel.Input))
                    {
                        ModelState.AddModelError("Input", "Not a responding website");
                        return(View("Index", model));
                    }
                    model.OutputViewModel = AnalysisURL(model.InputViewModel);
                }
                else
                {
                    model.OutputViewModel = AnalysisText(model.InputViewModel);
                }
            }
            return(View("Index", model));
        }