public static ValueResolver Create(SimpleReference reference) { var objectReference = reference as ObjectReference; if (!ReferenceEquals(null, objectReference)) { return(new ObjectValueResolver(objectReference)); } var functionReference = reference as FunctionReference; if (!ReferenceEquals(null, functionReference)) { if (FunctionHandlers.Exists(functionReference.Name)) { return(new AggregateValueResolver(functionReference)); } return(new FunctionValueResolver(functionReference)); } throw new InvalidOperationException("Unresolvable Reference type."); }
public AggregateValueResolver(FunctionReference reference) { _reference = reference; _argumentResolver = Create(reference.Argument); _handler = FunctionHandlers.Get(reference.Name); }
private static bool ReferenceIsNotAggregateFunction(SimpleReference reference) { var functionReference = reference as FunctionReference; return(ReferenceEquals(functionReference, null) || !FunctionHandlers.Exists(functionReference.Name)); }