예제 #1
0
        public IEnumerable <TParentEntity> ToList(int maxResults = 100)
        {
            BuildSql(maxResults);
            _metadatastore.AddEntity(typeof(TParentEntity));

            var listingAction = new ToListAction <TParentEntity>(_metadatastore, _hydrator,
                                                                 _connection, _dialect, _environment);

            return(listingAction.GetListing(_currentStatement, _queryParameters));
        }
예제 #2
0
        public IEnumerable <T> Execute(LinqExtender.Ast.Expression expression)
        {
            this._currentExpression = expression;
            this.Visit(expression);

            var listingAction = new ToListAction <T>(this._metadataStore,
                                                     this._hydrator, this._connection, _dialect, _environment);

            var entities = listingAction.GetListing(this.CurrentStatement, this._parameters);

            return(entities);
        }
예제 #3
0
        public IEnumerable <TParent> Select()
        {
            string statement = string.Empty;
            IDictionary <string, object> parameters = new Dictionary <string, object>();

            _definition.Parse(out statement, out parameters);

            var listingAction = new ToListAction <TParent>(MetaDataStore,
                                                           this._hydrator, this._connection, _dialect, _environment);

            var entities = listingAction.GetListing(statement, parameters);

            return(entities);
        }
예제 #4
0
        public IEnumerable <TEntity> Select()
        {
            var statement = string.Empty;
            IDictionary <string, object> parameters = null;

            _queryDefinition.Parse(out statement, out parameters);

            var listingAction = new ToListAction <TEntity>(_metadatastore,
                                                           this._hydrator, this._connection, _dialect, _environment);

            var entities = listingAction.GetListing(statement, parameters);

            return(entities);
        }
예제 #5
0
        public IEnumerable <TEntity> ToList <TEntity>(int maxResults = 100) where TEntity : class
        {
            if (typeof(TEntity) == typeof(TParentEntity))
            {
                throw new InvalidOperationException("Can not project " + typeof(TParentEntity).Name + " onto " +
                                                    typeof(TEntity).Name);
            }
            _metadatastore.AddEntity(typeof(TEntity));

            var listingAction = new ToListAction <TEntity>(_metadatastore, _hydrator,
                                                           _connection, _dialect, _environment);

            return(listingAction.GetListing(_currentStatement, _queryParameters));
        }
예제 #6
0
        public IEnumerable <TProjection> Select <TProjection>() where TProjection : class, new()
        {
            _metadatastore.AddEntity(typeof(TProjection));

            var statement = string.Empty;
            IDictionary <string, object> parameters = null;

            _queryDefinition.Parse(out statement, out parameters);

            var listingAction = new ToListAction <TProjection>(_metadatastore,
                                                               this._hydrator, this._connection, _dialect, _environment);

            var projections = listingAction.GetListing(statement, parameters);

            return(projections);
        }