private static void RecordField(QueryBuilderRecorder recorder, FieldInfo field) { recorder.Add(ctx => { ctx.Descend(field.Name); ctx.PushDescendigFieldEnumType(field.FieldType.IsEnum ? field.FieldType : null); }); }
private IQueryBuilderRecord ApplyDirection(IQueryBuilderRecord record) { QueryBuilderRecorder recorder = new QueryBuilderRecorder(record); recorder.Add(ctx => ApplyDirection(ctx.CurrentQuery)); return recorder.Record; }
public void Run(QueryBuilderRecorder recorder) { if (_queryExpression == null) throw new QueryOptimizationException("No query expression"); _queryExpression.Accept(new CodeQueryBuilder(recorder)); }
public CodeQueryBuilder(QueryBuilderRecorder recorder) { _recorder = recorder; }
public void Run(QueryBuilderRecorder recorder) { RecordField(recorder, GetBackingField(_method)); }
private IQueryBuilderRecord CreateRecord(Expression expression) { Recorder = new QueryBuilderRecorder(); Visit(expression); return Recorder.Record; }
protected void AnalyseMethod(QueryBuilderRecorder recorder, MethodInfo method) { try { var analyser = MethodAnalyser.FromMethod(method); analyser.Run(recorder); } catch (Exception e) { throw new QueryOptimizationException(e.Message, e); } }