示例#1
0
 private static void RecordField(QueryBuilderRecorder recorder, FieldInfo field)
 {
     recorder.Add(ctx =>
     {
         ctx.Descend(field.Name);
         ctx.PushDescendigFieldEnumType(field.FieldType.IsEnum ? field.FieldType : null);
     });
 }
示例#2
0
		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));
		}
示例#4
0
		public CodeQueryBuilder(QueryBuilderRecorder recorder)
		{
			_recorder = recorder;
		}
		public void Run(QueryBuilderRecorder recorder)
		{
			RecordField(recorder, GetBackingField(_method));
		}
示例#6
0
 private IQueryBuilderRecord CreateRecord(Expression expression)
 {
     Recorder = new QueryBuilderRecorder();
     Visit(expression);
     return Recorder.Record;
 }
示例#7
0
 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);
     }
 }