public async Task LoadCompanyStaticDataAsConstantAsync(IStaticDataRepository staticDataRepo) { var remarks = await staticDataRepo.LoadRemarkAsync(); foreach (Remark remark in remarks) { mcalcEnggine.AddConstant(remark.Code, remark.Value); } }
public void TestFormulaBuilderConstantCompiled() { CalculationEngine engine = new CalculationEngine(CultureInfo.InvariantCulture, ExecutionMode.Compiled); engine.AddConstant("age", 18.0); Func <int, double> function = (Func <int, double>)engine.Formula("age+var1") .Parameter("var1", DataType.Integer) .Result(DataType.FloatingPoint) .Build(); double result = function(3); Assert.AreEqual(21.0, result); }
private static void AddTrueFalseConstanta(CalculationEngine calculator) { calculator.AddConstant("true", 1); calculator.AddConstant("false", 0); }