public ClientManager(ITaskRepository taskRepository, IExpressionConverter expressionConverter, IJsonConverter jsonConverter, IUnitOfWorkFactory unitOfWorkFactory, IContextSettings contextSettings, ClientManagerConfiguration managerConfiguration) : base(managerConfiguration) { if (taskRepository == null) { throw new ArgumentNullException(nameof(taskRepository)); } if (expressionConverter == null) { throw new ArgumentNullException(nameof(expressionConverter)); } if (jsonConverter == null) { throw new ArgumentNullException(nameof(jsonConverter)); } if (unitOfWorkFactory == null) { throw new ArgumentNullException(nameof(unitOfWorkFactory)); } if (contextSettings == null) { throw new ArgumentNullException(nameof(contextSettings)); } this.taskRepository = taskRepository; this.expressionConverter = expressionConverter; this.jsonConverter = jsonConverter; this.unitOfWorkFactory = unitOfWorkFactory; this.contextSettings = contextSettings; }
public InputProcessor() { expressionConverter = new SimpleExpressionConverter(); tokenizer = new SimpleTokenizer(); parser = new PolynomialParser(tokenizer); sorter = new Sorter <PolynomialNode <double> >(); }
/// <summary> /// /// </summary> /// <param name="converter"></param> /// <param name="method"></param> /// <returns></returns> public override ExpressionElement Convert(IExpressionConverter converter, MethodCallExpression method) { var index = method.SkipMethodChain(0); var args = method.Arguments.Skip(index).Select(e => converter.Convert(e)).ToArray(); var name = string.IsNullOrEmpty(Name) ? method.Method.Name.ToUpper() : Name; var hArgs = new HText(args) { Separator = Separator }.ConcatToBack(")"); return new HText(Line(name, "("), hArgs) { IsFunctional = true }; }
public DbContextRepository( DbContext context, IEnumerable <IRepositoryEvents <Model> > events, IModelConverter modelConverter, IExpressionConverter expressionConverter ) : base(context, events, modelConverter, expressionConverter) { }
public override ExpressionElement Convert(IExpressionConverter converter, MethodCallExpression method) { var v = new VText(); var overMethod = method; v.Add(overMethod.Method.Name.ToUpper() + "("); v.AddRange(1, overMethod.Arguments.Skip(1). Where(e => !(e is ConstantExpression)). //Skip null. Select(e => converter.Convert(e)).ToArray()); return v.ConcatToBack(")"); }
public DbContextRepository( DbContext context, IEnumerable <IRepositoryEvents <Model> > events, IModelConverter modelConverter, IExpressionConverter expressionConverter ) { _context = context; _events = events; _modelConverter = modelConverter; _expressionConverter = expressionConverter; }
public override ExpressionElement Convert(IExpressionConverter converter, MethodCallExpression method) { var arg = method.Arguments[method.SkipMethodChain(0)]; var array = arg as NewArrayExpression; var orderBy = new VText(); orderBy.Add("ORDER BY"); var sort = new VText() { Separator = "," }; sort.AddRange(1, array.Expressions.Select(e => converter.Convert(e)).ToList()); orderBy.Add(sort); return orderBy; }
public TaskBuilder(IExpressionConverter expressionConverter, IJsonConverter jsonConverter) { if (expressionConverter == null) { throw new ArgumentNullException(nameof(expressionConverter)); } if (jsonConverter == null) { throw new ArgumentNullException(nameof(jsonConverter)); } this.expressionConverter = expressionConverter; this.jsonConverter = jsonConverter; }
/// <summary> /// Constructor. /// </summary> /// <param name="expressionConverter">The <see cref="IExpressionConverter"/> instance.</param> /// <param name="jsonConverter">JSON converter.</param> /// <param name="loggerFactory">The <see cref="ICommonLoggerFactory"/> instance.</param> /// <exception cref="ArgumentNullException"><paramref name="expressionConverter"/> is <see langword="null" />.</exception> /// <exception cref="ArgumentNullException"><paramref name="jsonConverter"/> is <see langword="null" />.</exception> /// <exception cref="ArgumentNullException"><paramref name="loggerFactory"/> is <see langword="null" />.</exception> public TaskConverter(IExpressionConverter expressionConverter, IJsonConverter jsonConverter, ICommonLoggerFactory loggerFactory) : base(loggerFactory) { if (expressionConverter == null) { throw new ArgumentNullException("expressionConverter"); } if (jsonConverter == null) { throw new ArgumentNullException("jsonConverter"); } this.expressionConverter = expressionConverter; this.jsonConverter = jsonConverter; }
public override ExpressionElement Convert(IExpressionConverter converter, MethodCallExpression method) { var partitionBy = new VText(); partitionBy.Add("PARTITION BY"); var elements = new VText() { Indent = 1, Separator = "," }; var array = method.Arguments[0] as NewArrayExpression; foreach (var e in array.Expressions.Select(e => converter.Convert(e))) { elements.Add(e); } partitionBy.Add(elements); return partitionBy; }
/// <summary> /// Constructor. /// </summary> /// <param name="expressionConverter">The <see cref="IExpressionConverter"/> instance.</param> /// <param name="taskDataContext">The <see cref="ITaskDataContext"/> instance.</param> /// <param name="serverManager">The <see cref="IQueueManager"/> instance.</param> /// <param name="queueManager">The <see cref="IServerManager"/> instance.</param> /// <param name="loggerFactory">The <see cref="ICommonLoggerFactory"/> instance.</param> /// <exception cref="ArgumentNullException"><paramref name="expressionConverter"/> is <see langword="null" />.</exception> /// <exception cref="ArgumentNullException"><paramref name="taskDataContext"/> is <see langword="null" />.</exception> /// <exception cref="ArgumentNullException"><paramref name="serverManager"/> is <see langword="null" />.</exception> /// <exception cref="ArgumentNullException"><paramref name="queueManager"/> is <see langword="null" />.</exception> public TaskManager(TaskManagerConfiguration taskManagerConfiguration, ITaskBuilder taskBuilder, IExpressionConverter expressionConverter, ITaskDataContext taskDataContext, IServerManager serverManager, IQueueManager queueManager, ICommonLoggerFactory loggerFactory) : base("Task Manager", loggerFactory) { if (taskManagerConfiguration == null) { throw new ArgumentNullException(nameof(taskManagerConfiguration)); } if (taskBuilder == null) { throw new ArgumentNullException(nameof(taskBuilder)); } if (expressionConverter == null) { throw new ArgumentNullException("expressionConverter"); } if (taskDataContext == null) { throw new ArgumentNullException("taskDataContext"); } if (serverManager == null) { throw new ArgumentNullException("serverManager"); } if (queueManager == null) { throw new ArgumentNullException("queueManager"); } this.taskBuilder = taskBuilder; this.expressionConverter = expressionConverter; this.taskDataContext = taskDataContext; this.serverManager = serverManager; this.queueManager = queueManager; activeTasks = new Dictionary <Int64, IRunningTask>(); maxRerunCount = taskManagerConfiguration.MaxRerunAttempts; maxTasksPerQueue = taskManagerConfiguration.MaxTaskPerQueue; timeShiftAfterCrash = taskManagerConfiguration.TimeShiftAfterCrash; taskManagerState = taskManagerConfiguration.State; }
public override ExpressionElement Convert(IExpressionConverter converter, MethodCallExpression method) { var args = method.Arguments.Select(e => converter.Convert(e)).ToArray(); return Clause(LineSpace(args[0], "BETWEEN"), args[1], "AND", args[2]); }
/// <summary> /// /// </summary> /// <param name="converter"></param> /// <param name="member"></param> /// <returns></returns> public override ExpressionElement Convert(IExpressionConverter converter, MemberExpression member) => string.IsNullOrEmpty(Name) ? member.Member.Name.ToUpper() : Name;
public void Setup() { _converter = new ExpressionConverter(); }
public override ExpressionElement Convert(IExpressionConverter converter, NewExpression exp) { ExpressionElement arg1 = converter.Convert(exp.Arguments[0]).Customize(new CustomizeColumnOnly()); return new HText(arg1, "=", converter.Convert(exp.Arguments[1])) { Separator = " " }; }
public ExpressionCompiler(IExpressionConverter expressionConverter, ICompileStrategyFactory compileStrategyFactory) { _expressionConverter = expressionConverter; _compileStrategyFactory = compileStrategyFactory; }
public override ExpressionElement Convert(IExpressionConverter converter, MethodCallExpression method) { var args = method.Arguments.Select(e => converter.Convert(e)).ToArray(); return FuncSpace("CAST", args[0], "AS", args[1].Customize(new CustomizeParameterToObject())); }
public override ExpressionElement Convert(IExpressionConverter converter, MethodCallExpression method) => LineSpace(converter.Convert(method.Arguments[0]), method.Method.Name.ToUpper());
public override ExpressionElement Convert(IExpressionConverter converter, MethodCallExpression method) { var text = (string)converter.ToObject(method.Arguments[0]); var array = method.Arguments[1] as NewArrayExpression; return new StringFormatText(text, array.Expressions.Select(e => converter.Convert(e)).ToArray()); }
/// <summary> /// /// </summary> /// <param name="converter"></param> /// <param name="exp"></param> /// <returns></returns> public abstract ExpressionElement Convert(IExpressionConverter converter, MemberExpression exp);
public override ExpressionElement Convert(IExpressionConverter converter, NewExpression exp) { var obj = converter.ToObject(exp.Arguments[0]); return (bool)obj ? converter.Convert(exp.Arguments[1]) : (ExpressionElement)string.Empty; }
public override ExpressionElement Convert(IExpressionConverter converter, MethodCallExpression method) => new CurrentDateTimeExpressionElement(Name);
public override ExpressionElement Convert(IExpressionConverter converter, MethodCallExpression method) { var args = method.Arguments.Select(e => converter.Convert(e)).ToArray(); return new DisableBracketsText(Func("ALL", args[0])); }
/// <summary> /// Instantiates a new <see cref="ExpressionCompiler"/> object. /// </summary> public ExpressionCompiler() { _expressionConverter = new ExpressionConverter(); }