1234567891011121314151617 |
- using System;
- using FormulaEnginePoC.FormulaEngine;
- namespace FormulaEnginePoC.CSharpProvider
- {
- public class FormulaCompiler
- {
- public static Func<TSource, TResult> Compile<TSource, TResult>(string expression)
- {
- var exp = new ExpressionCompiler<Func<TSource, TResult>>(expression);
- exp.AddReferenceAssembly(typeof(MoreFunction).Assembly.Location);
- exp.AddNamespace(typeof(MoreFunction).Namespace);
- exp.Compile();
- return exp.CompiledDelegate;
- }
- }
- }
|