public ActionResult EquationGeneratorForm(string abbreviation)
        {
            EquationsRepository equationRespository = new EquationsRepository(Cache, ReadEquationData);
            Equation requestedEquation = equationRespository.GetAnEquation(abbreviation);
            EquationAnswerViewModel equationAnswerViewModel = new EquationAnswerViewModel();
            if(requestedEquation!=null)
            {
                equationAnswerViewModel.myEquation = requestedEquation;
            }

            return View(equationAnswerViewModel);
        }
        public ActionResult EquationGeneratorForm(FormCollection collection)
        {
            string equationQuery = string.Empty;
            string equation = string.Empty;
            double answer = 0;
            string error = string.Empty;

            EquationAnswerViewModel equationAnswerViewModel = new EquationAnswerViewModel();
            EquationsRepository equationRespository = new EquationsRepository(Cache, ReadEquationData);

            if (collection.AllKeys.Contains("abbreviation"))
            {
                equationQuery = collection["abbreviation"];

                Equation requestedEquation = equationRespository.GetAnEquation(equationQuery);

                if (requestedEquation != null)
                {
                    equation = requestedEquation.EquationExpression;
                    equationAnswerViewModel.myEquation = requestedEquation;
                }

                //Substitute my variable in equation with value from user.
                foreach (string key in collection.Keys)
                {
                    string tmp = collection[key];

                    if (equation.Contains(key))
                    {
                        equation = equation.Replace(key, tmp);
                        if (equationAnswerViewModel.myCollection==null)
                        {
                            equationAnswerViewModel.myCollection = new Dictionary<string, string>();
                        }
                        equationAnswerViewModel.myCollection.Add(key, tmp);
                    }
                }

                if (MathExpressionParser.SolveExpression(equation, out answer, out error))
                {
                    equationAnswerViewModel.myAnswer = answer;
                }
                else
                {
                    myLogger.Error("Error using SimpleCalculatorService: "+error);
                    return View("Error");
                }

                //DemoMVC.SimpleCalcServiceConsoleHost.CalculatorClient calculatorClient = new SimpleCalcServiceConsoleHost.CalculatorClient();

                //try
                //{
                //    answer = calculatorClient.SolveExpression(equation);
                //    equationAnswerViewModel.myAnswer = double.Parse(answer);
                //    // More code that isn't useful including here ...

                //}
                //catch (Exception e)
                //{
                //    ErrorSignal.FromCurrentContext().Raise(e);
                //    //logger.Error("Error using SimpleCalculatorService.", e);
                //}
                //finally
                //{
                //    calculatorClient.Close();
                //}

            }
            else
            {
                myLogger.Error("Key not found.");
                return View("Error");
            }

            return View(equationAnswerViewModel);
        }