/// <summary> /// Initializes a new instance of the QueryClrCollectionType class. /// </summary> /// <param name="clrType">Wrapped CLR type.</param> /// <param name="elementType">Type of a single element in the collection.</param> /// <param name="evaluationStrategy">The evaluation strategy.</param> public QueryClrCollectionType(Type clrType, TQueryType elementType, IQueryEvaluationStrategy evaluationStrategy) : base(elementType, evaluationStrategy) { ExceptionUtilities.CheckArgumentNotNull(clrType, "clrType"); ExceptionUtilities.CheckArgumentNotNull(elementType, "elementType"); this.ClrType = clrType; }
/// <summary> /// Resolves types for the specified expression. /// </summary> /// <param name="expression">The expression to resolve types for.</param> /// <param name="evaluationStrategy">Evaluation strategy.</param> /// <returns>Expression with resolved types.</returns> public QueryExpression ResolveTypes(QueryExpression expression, IQueryEvaluationStrategy evaluationStrategy) { // TODO: possibly inject evaluation strategy, and move it to constructor this.EvaluationStrategy = evaluationStrategy; return(this.ResolveTypes(expression)); }
/// <summary> /// Initializes a new instance of the QueryClrPrimitiveType class. /// </summary> /// <param name="clrType">Wrapped CLR type.</param> /// <param name="evaluationStrategy">The evaluation strategy.</param> public QueryClrPrimitiveType(Type clrType, IQueryEvaluationStrategy evaluationStrategy) : base(evaluationStrategy) { ExceptionUtilities.CheckArgumentNotNull(clrType, "clrType"); this.ClrType = clrType; }
/// <summary> /// Initializes a new instance of the QueryStructuralType class. /// </summary> /// <param name="evaluationStrategy">The evaluation strategy.</param> protected QueryStructuralType(IQueryEvaluationStrategy evaluationStrategy) : base(evaluationStrategy) { this.Properties = new List <QueryProperty>(); this.DerivedTypes = new List <QueryStructuralType>(); this.IsReadOnly = false; }
/// <summary> /// Initializes a new instance of the QueryStructuralType class. /// </summary> /// <param name="evaluationStrategy">The evaluation strategy.</param> protected QueryStructuralType(IQueryEvaluationStrategy evaluationStrategy) : base(evaluationStrategy) { this.Properties = new List<QueryProperty>(); this.DerivedTypes = new List<QueryStructuralType>(); this.IsReadOnly = false; }
/// <summary> /// Initializes a new instance of the QueryComplexType class. /// </summary> /// <param name="evaluationStrategy">The evaluation strategy.</param> /// <param name="complexType">Complex type to wrap.</param> /// <param name="clrType">The CLR corresponding to the complex type.</param> public QueryComplexType(IQueryEvaluationStrategy evaluationStrategy, ComplexType complexType, Type clrType) : base(evaluationStrategy) { ExceptionUtilities.CheckArgumentNotNull(complexType, "complexType"); this.ComplexType = complexType; this.ClrType = clrType; }
/// <summary> /// Initializes a new instance of the QueryValue class. /// </summary> /// <param name="evaluationError">The evaluation error.</param> /// <param name="evaluationStrategy">The evaluation strategy.</param> protected QueryValue(QueryError evaluationError, IQueryEvaluationStrategy evaluationStrategy) : base() { ExceptionUtilities.CheckArgumentNotNull(evaluationStrategy, "evaluationStrategy"); this.EvaluationStrategy = evaluationStrategy; this.EvaluationError = evaluationError; }
/// <summary> /// Initializes a new instance of the QueryClrSpatialType class. /// </summary> /// <param name="clrType">Wrapped CLR type.</param> /// <param name="evaluationStrategy">The evaluation strategy.</param> public QueryClrSpatialType(Type clrType, IQueryEvaluationStrategy evaluationStrategy) : base(clrType, evaluationStrategy) { this.Properties = new List<QueryProperty>(); this.Methods = new List<Function>(); this.DerivedTypes = new List<QueryClrSpatialType>(); this.IsReadOnly = false; }
/// <summary> /// Initializes a new instance of the QueryTypeLibrary class. /// </summary> /// <param name="strategy">The query evaluation strategy</param> /// <param name="storeTypeResolver">The store primitive type resolver</param> /// <param name="modelTypeResolver">The model primitive type resolver</param> public QueryTypeLibrary(IQueryEvaluationStrategy strategy, IPrimitiveDataTypeResolver storeTypeResolver, IPrimitiveDataTypeResolver modelTypeResolver) { this.evaluationStrategy = strategy; this.storeDataTypeResolver = storeTypeResolver; this.modelDataTypeResolver = modelTypeResolver; this.getDefaultQueryTypeVisitor = new GetDefaultQueryTypeVisitor(this); }
/// <summary> /// Initializes a new instance of the QueryClrEnumType class. /// </summary> /// <param name="evaluationStrategy">The evaluation strategy.</param> /// <param name="enumType">The wrapped enum type.</param> /// <param name="clrType">Wrapped CLR type.</param> public QueryClrEnumType(IQueryEvaluationStrategy evaluationStrategy, EnumType enumType, Type clrType) : base(evaluationStrategy) { ExceptionUtilities.CheckArgumentNotNull(enumType, "enumType"); this.EnumType = enumType; this.ClrType = clrType; }
/// <summary> /// Initializes a new instance of the QueryClrSpatialType class. /// </summary> /// <param name="clrType">Wrapped CLR type.</param> /// <param name="evaluationStrategy">The evaluation strategy.</param> public QueryClrSpatialType(Type clrType, IQueryEvaluationStrategy evaluationStrategy) : base(clrType, evaluationStrategy) { this.Properties = new List <QueryProperty>(); this.Methods = new List <Function>(); this.DerivedTypes = new List <QueryClrSpatialType>(); this.IsReadOnly = false; }
/// <summary> /// Initializes a new instance of the QueryEntityType class. /// </summary> /// <param name="evaluationStrategy">The evaluation strategy.</param> /// <param name="entityType">Type of the entity.</param> /// <param name="entitySet">The set that the entity belongs to</param> /// <param name="clrType">CLR type of the entity.</param> public QueryEntityType(IQueryEvaluationStrategy evaluationStrategy, EntityType entityType, EntitySet entitySet, Type clrType) : base(evaluationStrategy) { ExceptionUtilities.CheckArgumentNotNull(entityType, "entityType"); ExceptionUtilities.CheckArgumentNotNull(entitySet, "entitySet"); this.EntityType = entityType; this.EntitySet = entitySet; this.ClrType = clrType; }
/// <summary> /// Initializes a new instance of the QueryGroupingType class. /// </summary> /// <param name="keyType">Type of the grouping key.</param> /// <param name="elementType">Type of the grouping element.</param> /// <param name="evaluationStrategy">Evaluation strategy.</param> public QueryGroupingType(QueryType keyType, QueryType elementType, IQueryEvaluationStrategy evaluationStrategy) : base(evaluationStrategy) { this.Key = QueryProperty.Create("Key", keyType); this.elementType = elementType; QueryCollectionType collectionType = elementType.CreateCollectionType(); this.Elements = QueryProperty.Create("Elements", collectionType); this.AddProperties(new[] { this.Key, this.Elements }); this.MakeReadOnly(); }
/// <summary> /// Initializes a new instance of the QueryCollectionValue class. /// </summary> /// <param name="type">The collection type.</param> /// <param name="evaluationStrategy">The evaluation strategy.</param> /// <param name="evaluationError">The evaluation error.</param> /// <param name="elements">The elements.</param> /// <param name="isSorted">Determines whether the collection is sorted.</param> public QueryCollectionValue(QueryCollectionType type, IQueryEvaluationStrategy evaluationStrategy, QueryError evaluationError, IEnumerable <QueryValue> elements, bool isSorted) : base(evaluationError, evaluationStrategy) { ExceptionUtilities.CheckArgumentNotNull(type, "type"); this.IsSorted = isSorted; this.Type = type; if (elements == null) { this.Elements = null; } else { this.Elements = elements.ToList(); } }
/// <summary> /// Initializes a new instance of the QueryCollectionValue class. /// </summary> /// <param name="type">The collection type.</param> /// <param name="evaluationStrategy">The evaluation strategy.</param> /// <param name="evaluationError">The evaluation error.</param> /// <param name="elements">The elements.</param> public QueryCollectionValue(QueryCollectionType type, IQueryEvaluationStrategy evaluationStrategy, QueryError evaluationError, IEnumerable <QueryValue> elements) : this(type, evaluationStrategy, evaluationError, elements, false) { }
/// <summary> /// Initializes a new instance of the QueryTypeLibraryBuilderBase class. /// </summary> /// <param name="evaluationStrategy">The query evaluation strategy</param> protected QueryTypeLibraryBuilderBase(IQueryEvaluationStrategy evaluationStrategy) { this.EvaluationStrategy = evaluationStrategy; }
/// <summary> /// Initializes a new instance of the AstoriaQueryStreamValue class. /// </summary> /// <param name="type">The type of the value.</param> /// <param name="value">The value.</param> /// <param name="evaluationError">The evaluation error.</param> /// <param name="evaluationStrategy">The evaluation strategy.</param> public AstoriaQueryStreamValue(AstoriaQueryStreamType type, byte[] value, QueryError evaluationError, IQueryEvaluationStrategy evaluationStrategy) : base(evaluationError, evaluationStrategy) { ExceptionUtilities.CheckArgumentNotNull(type, "type"); this.Type = type; this.Value = value; }
/// <summary> /// Initializes a new instance of the QueryStreamType class. /// </summary> /// <param name="evaluationStrategy">The evaluation strategy.</param> protected QueryStreamType(IQueryEvaluationStrategy evaluationStrategy) : base(evaluationStrategy) { }
/// <summary> /// Initializes a new instance of the QueryRecordValue class. /// </summary> /// <param name="type">The type of the value.</param> /// <param name="isNull">If set to <c>true</c> the record value is null.</param> /// <param name="evaluationError">The evaluation error.</param> /// <param name="evaluationStrategy">The evaluation strategy.</param> public QueryRecordValue(QueryRecordType type, bool isNull, QueryError evaluationError, IQueryEvaluationStrategy evaluationStrategy) : base(evaluationError, evaluationStrategy) { ExceptionUtilities.CheckArgumentNotNull(type, "type"); this.Type = type; this.isNull = isNull; this.SetupInitialMemberValues(); }
/// <summary> /// Initializes a new instance of the QueryEntityValue class. /// </summary> /// <param name="type">The type of the value.</param> /// <param name="isNull">If set to <c>true</c> the structural value is null.</param> /// <param name="evaluationError">The evaluation error.</param> /// <param name="evaluationStrategy">The evaluation strategy.</param> internal QueryEntityValue(QueryEntityType type, bool isNull, QueryError evaluationError, IQueryEvaluationStrategy evaluationStrategy) : base(type, isNull, evaluationError, evaluationStrategy) { this.navigateResultLookup = new Dictionary<AssociationType, Dictionary<AssociationEnd, QueryValue>>(); }
/// <summary> /// Initializes a new instance of the QueryMappedScalarTypeWithStructure class. /// </summary> /// <param name="modelType">The conceptual model type.</param> /// <param name="storeType">The store model type.</param> /// <param name="evaluationStrategy">The evaluation strategy.</param> public QueryMappedScalarTypeWithStructure(SpatialDataType modelType, SpatialDataType storeType, IQueryEvaluationStrategy evaluationStrategy) : base(modelType, storeType, evaluationStrategy) { this.Properties = new List <QueryProperty>(); this.Methods = new List <Function>(); this.IsReadOnly = false; }
/// <summary> /// Initializes a new instance of the QueryStructuralValue class. /// </summary> /// <param name="type">The type of the value.</param> /// <param name="isNull">If set to <c>true</c> the structural value is null.</param> /// <param name="evaluationError">The evaluation error.</param> /// <param name="evaluationStrategy">The evaluation strategy.</param> public QueryStructuralValue(QueryStructuralType type, bool isNull, QueryError evaluationError, IQueryEvaluationStrategy evaluationStrategy) : base(evaluationError, evaluationStrategy) { ExceptionUtilities.CheckArgumentNotNull(type, "type"); this.Type = type; this.isNull = isNull; }
/// <summary> /// Initializes a new instance of the QueryEntityValue class. /// </summary> /// <param name="type">The type of the value.</param> /// <param name="isNull">If set to <c>true</c> the structural value is null.</param> /// <param name="evaluationError">The evaluation error.</param> /// <param name="evaluationStrategy">The evaluation strategy.</param> internal QueryEntityValue(QueryEntityType type, bool isNull, QueryError evaluationError, IQueryEvaluationStrategy evaluationStrategy) : base(type, isNull, evaluationError, evaluationStrategy) { this.navigateResultLookup = new Dictionary <AssociationType, Dictionary <AssociationEnd, QueryValue> >(); }
/// <summary> /// Initializes a new instance of the QueryCollectionType class. /// </summary> /// <param name="elementType">Type of a single element in the collection.</param> /// <param name="evaluationStrategy">The evaluation strategy.</param> internal QueryCollectionType(TElement elementType, IQueryEvaluationStrategy evaluationStrategy) : base(elementType, evaluationStrategy) { }
/// <summary> /// Initializes a new instance of the LinqLambdaType class. /// </summary> /// <param name="bodyType">Type of the lambda body.</param> /// <param name="parameterTypes">List of the lambda parameter types.</param> /// <param name="evaluationStrategy">The evaluation strategy.</param> internal LinqLambdaType(QueryType bodyType, IEnumerable <QueryType> parameterTypes, IQueryEvaluationStrategy evaluationStrategy) : base(evaluationStrategy) { this.BodyType = bodyType; this.ParameterTypes = parameterTypes.ToList().AsReadOnly(); }
/// <summary> /// Initializes a new instance of the QueryReferenceType class. /// </summary> /// <param name="evaluationStrategy">The evaluation strategy</param> /// <param name="queryEntityType">The referenced query entity type</param> internal QueryReferenceType(IQueryEvaluationStrategy evaluationStrategy, QueryEntityType queryEntityType) : base(evaluationStrategy) { ExceptionUtilities.CheckArgumentNotNull(queryEntityType, "queryEntityType"); this.QueryEntityType = queryEntityType; }
/// <summary> /// Initializes a new instance of the QueryScalarType class. /// </summary> /// <param name="evaluationStrategy">The evaluation strategy.</param> protected QueryScalarType(IQueryEvaluationStrategy evaluationStrategy) : base(evaluationStrategy) { }
/// <summary> /// Resolves type and body expression for functions in the model /// </summary> /// <param name="expression">the expression to resolve</param> /// <param name="strategy">the query evaluation strategy</param> /// <returns>the resolved expression</returns> public QueryExpression ResolveCustomFunctions(QueryExpression expression, IQueryEvaluationStrategy strategy) { this.queryEvaluationStrategy = strategy; return expression.Accept(this); }
/// <summary> /// Initializes a new instance of the QueryScalarValue class. /// </summary> /// <param name="type">The type of the value.</param> /// <param name="value">The value.</param> /// <param name="evaluationError">The evaluation error.</param> /// <param name="evaluationStrategy">The evaluation strategy.</param> public QueryScalarValue(QueryScalarType type, object value, QueryError evaluationError, IQueryEvaluationStrategy evaluationStrategy) : base(evaluationError, evaluationStrategy) { ExceptionUtilities.CheckArgumentNotNull(type, "type"); this.Type = type; this.Value = value; }
/// <summary> /// Resolves type and body expression for functions in the model /// </summary> /// <param name="expression">the expression to resolve</param> /// <param name="strategy">the query evaluation strategy</param> /// <returns>the resolved expression</returns> public QueryExpression ResolveCustomFunctions(QueryExpression expression, IQueryEvaluationStrategy strategy) { this.queryEvaluationStrategy = strategy; return(expression.Accept(this)); }
private MaskedQueryStructuralValue(QueryStructuralType type, bool isNull, QueryError evaluationError, IQueryEvaluationStrategy evaluationStrategy) : base(type, isNull, evaluationError, evaluationStrategy) { }
/// <summary> /// Initializes a new instance of the QueryTypeLibrary class. /// </summary> /// <param name="evaluationStrategy">The query evaluation strategy</param> public QueryTypeLibrary(IQueryEvaluationStrategy evaluationStrategy) : this(evaluationStrategy, null, null) { }
/// <summary> /// Initializes a new instance of the QueryCollectionType class. /// </summary> /// <param name="elementType">Type of a single element in the collection.</param> /// <param name="evaluationStrategy">The evaluation strategy.</param> protected QueryCollectionType(QueryType elementType, IQueryEvaluationStrategy evaluationStrategy) : base(evaluationStrategy) { this.ElementType = elementType; }
/// <summary> /// Initializes a new instance of the AstoriaQueryStreamType class. /// </summary> /// <param name="evaluationStrategy">The evaluation strategy.</param> public AstoriaQueryStreamType(IQueryEvaluationStrategy evaluationStrategy) : base(evaluationStrategy) { }
/// <summary> /// Initializes a new instance of the QueryRecordType class. /// </summary> /// <param name="evaluationStrategy">The evaluation strategy.</param> public QueryRecordType(IQueryEvaluationStrategy evaluationStrategy) : base(evaluationStrategy) { }