Exemple #1
0
        public IActionResult Index(Operation model)
        {
            var factory   = new CalcFactory();
            var operation = factory.GetOperation(model.OperationType);

            model.Result = operation.MathOperation(model.NumberA, model.NumberB);

            return(View(model));
        }
Exemple #2
0
        public Type CalcFactoryTest(OperationType operation)
        {
            var factory = new CalcFactory();

            return(factory.GetOperation(operation).GetType());
        }