public override bool After(object returnObject, IMethodInvocation invocation)
        {
            try
            {
                var exps = ConfigureEntity.ExpModels;

                if (exps == null)
                {
                    return(true);
                }


                bool rtn = ExpressionUtils.Eval(Session, invocation, exps, ConfigureEntity.ExpVarModels);
                return(rtn);

                //var exps = ConfigureEntity.ExpModels;
                //string expression = string.Empty;
                //if (exps!=null && exps.Count >0)
                //{
                //    expression = ConfigureEntity.ExpModels[0].ExpText;
                //}
                //if (!string.IsNullOrWhiteSpace(expression)) return true;

                //bool rtn = ExpressionUtils.Eval(Session, invocation, expression, ConfigureEntity.ExpVarModels);
                //return rtn;
            }
            catch (Exception)
            {
                throw;
            }
        }
        public void FloatingRateWithParamTest()
        {
            var expression = new ExpressionUtils("CNL003Y + 3%");

            expression.AddParam("CNL003Y", 0.0475);
            var result = expression.Eval <double>();

            Assert.AreEqual(result, 0.0775);
        }
        public void FloatingRateTest()
        {
            double d = 2 / 100.0d + 3.3 / 100.0d;

            Console.Write(d);

            var expression = new ExpressionUtils("2% + 3.3%");
            var tObj       = expression.Eval <double>();

            Assert.AreEqual(tObj, 0.053);
        }
        public void FloatingRateWithParamTest2()
        {
            var expression = new ExpressionUtils("A + 3% + B - C + d");

            expression.AddParam("A", 0.0475);
            expression.AddParam("B", 0.0475);
            expression.AddParam("C", 0.0475);
            expression.AddParam("d", 0.0475);
            var result = expression.Eval <double>();

            result = new ExpressionUtils("A + 3% + BBB - CC + 3 + d+BBB-BBB")
                     .AddParam("A", 1)
                     .AddParam("BBB", 3)
                     .AddParam("CC", 5)
                     .AddParam("d", 4).Eval <double>();
            Assert.AreEqual(result, 6.03);
        }
        public override bool Before(IMethodInvocation invocation)
        {
            try
            {
                var exps = ConfigureEntity.ExpModels;

                if (exps == null)
                {
                    return(true);
                }


                bool rtn = ExpressionUtils.Eval(Session, invocation, exps, ConfigureEntity.ExpVarModels);
                return(rtn);
            }
            catch (Exception)
            {
                throw;
            }
        }