/// <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));
        }
示例#3
0
        /// <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;
        }
示例#4
0
 /// <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;
 }
示例#5
0
 /// <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;
 }
示例#6
0
        /// <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;
        }
示例#7
0
        /// <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;
 }
示例#9
0
        /// <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);
        }
示例#10
0
        /// <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;
        }
示例#11
0
 /// <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;
 }
示例#12
0
        /// <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;
        }
示例#13
0
        /// <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();
        }
示例#14
0
        /// <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();
            }
        }
示例#15
0
 /// <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;
 }
示例#17
0
        /// <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;
        }
示例#18
0
 /// <summary>
 /// Initializes a new instance of the QueryStreamType class.
 /// </summary>
 /// <param name="evaluationStrategy">The evaluation strategy.</param>
 protected QueryStreamType(IQueryEvaluationStrategy evaluationStrategy)
     : base(evaluationStrategy)
 {
 }
示例#19
0
        /// <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();
        }
示例#20
0
 /// <summary>
 /// Initializes a new instance of the QueryStreamType class.
 /// </summary>
 /// <param name="evaluationStrategy">The evaluation strategy.</param>
 protected QueryStreamType(IQueryEvaluationStrategy evaluationStrategy)
     : base(evaluationStrategy)
 {
 }
示例#21
0
 /// <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>>();
 }
示例#22
0
 /// <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;
 }
示例#23
0
        /// <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;
        }
示例#24
0
 /// <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> >();
 }
示例#25
0
 /// <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)
 {
 }
示例#26
0
 /// <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();
 }
示例#27
0
 /// <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;
 }
示例#28
0
 /// <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);
 }
示例#30
0
        /// <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;
        }
示例#31
0
 /// <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)
 {
 }
示例#33
0
 /// <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)
 {
 }
示例#34
0
 /// <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;
 }
示例#35
0
 /// <summary>
 /// Initializes a new instance of the QueryScalarType class.
 /// </summary>
 /// <param name="evaluationStrategy">The evaluation strategy.</param>
 protected QueryScalarType(IQueryEvaluationStrategy evaluationStrategy)
     : base(evaluationStrategy)
 {
 }
示例#36
0
 /// <summary>
 /// Initializes a new instance of the AstoriaQueryStreamType class.
 /// </summary>
 /// <param name="evaluationStrategy">The evaluation strategy.</param>
 public AstoriaQueryStreamType(IQueryEvaluationStrategy evaluationStrategy)
     : base(evaluationStrategy)
 {
 }
示例#37
0
 /// <summary>
 /// Initializes a new instance of the QueryRecordType class.
 /// </summary>
 /// <param name="evaluationStrategy">The evaluation strategy.</param>
 public QueryRecordType(IQueryEvaluationStrategy evaluationStrategy)
     : base(evaluationStrategy)
 {
 }
 private MaskedQueryStructuralValue(QueryStructuralType type, bool isNull, QueryError evaluationError, IQueryEvaluationStrategy evaluationStrategy)
     : base(type, isNull, evaluationError, evaluationStrategy)
 {
 }