Esempio n. 1
0
        IEnumerable <T> IQueryExecutor.ExecuteCollection <T>(QueryModel queryModel)
        {
            Tenant.EnsureStorageExists(queryModel.SourceType());

            var handler = new LinqQuery <T>(Store, queryModel, _includes.ToArray(), Statistics).ToList();

            return(Connection.Fetch(handler, IdentityMap.ForQuery(), Statistics, Tenant));
        }
Esempio n. 2
0
        T IQueryExecutor.ExecuteScalar <T>(QueryModel queryModel)
        {
            var handler = Schema.HandlerFactory.HandlerForScalarQuery <T>(queryModel, Includes.ToArray(), Statistics);

            if (handler == null)
            {
                throw new NotSupportedException("Not yet supporting these results: " +
                                                queryModel.AllResultOperators().Select(x => x.GetType().Name).Join(", "));
            }

            return(Connection.Fetch(handler, IdentityMap.ForQuery(), Statistics));
        }
Esempio n. 3
0
        T IQueryExecutor.ExecuteSingle <T>(QueryModel queryModel, bool returnDefaultWhenEmpty)
        {
            var handler = Store.HandlerFactory.HandlerForSingleQuery <T>(queryModel, _includes.ToArray(), Statistics,
                                                                         returnDefaultWhenEmpty);

            if (handler == null)
            {
                throw new NotSupportedException("Not yet supporting these results: " +
                                                queryModel.AllResultOperators().Select(x => x.GetType().Name).Join(", "));
            }

            return(Connection.Fetch(handler, IdentityMap.ForQuery(), Statistics, Tenant));
        }