Esempio n. 1
0
        public override sealed object EventMany(Query <TModel> query)
        {
            var whereCompressed = CompressWhere(query.Where);
            var orderCompressed = CompressOrder(query.Order);

            var appenedQuery = new Query <TModel>(query);

            appenedQuery.Where = whereCompressed;
            appenedQuery.Order = orderCompressed;

            var eventModels = (ICollection <EventModel <TModel> >)(NextProvider.Query(appenedQuery));

            if (eventModels.Count == 0)
            {
                return(eventModels);
            }

            var compressedModels = eventModels.Select(x => x.Model).ToArray();
            var models           = DecompressModels(compressedModels, query.Graph, true);
            int i = 0;

            foreach (var eventModel in eventModels)
            {
                eventModel.Model = compressedModels[i];
                i++;
            }

            return(eventModels);
        }
 public object Query(Query <TModel> query)
 {
     if (query.IsTemporal)
     {
         return(ThisProvider.Query(query));
     }
     else
     {
         return(NextProvider.Query(query));
     }
 }
Esempio n. 3
0
        public override sealed object Any(Query <TModel> query)
        {
            var whereCompressed = CompressWhere(query.Where);

            var appenedQuery = new Query <TModel>(query);

            appenedQuery.Where = whereCompressed;

            var any = NextProvider.Query(appenedQuery);

            return(any);
        }
        public override sealed object Count(Query <TModel> query)
        {
            var whereCompressed = EncryptWhere(query.Where);

            var appenedQuery = new Query <TModel>(query);

            appenedQuery.Where = whereCompressed;

            var count = NextProvider.Query(appenedQuery);

            return(count);
        }
Esempio n. 5
0
        public override sealed object Single(Query <TModel> query)
        {
            var whereCompressed = CompressWhere(query.Where);

            var appenedQuery = new Query <TModel>(query);

            appenedQuery.Where = whereCompressed;

            var compressedModels = (TModel)(NextProvider.Query(appenedQuery));

            if (compressedModels == null)
            {
                return(null);
            }

            var model = DecompressModel(compressedModels, query.Graph, true);

            return(model);
        }
Esempio n. 6
0
        public override sealed object Many(Query <TModel> query)
        {
            var whereCompressed = CompressWhere(query.Where);
            var orderCompressed = CompressOrder(query.Order);

            var appenedQuery = new Query <TModel>(query);

            appenedQuery.Where = whereCompressed;
            appenedQuery.Order = orderCompressed;

            var compressedModels = (ICollection <TModel>)(NextProvider.Query(appenedQuery));

            if (compressedModels.Count == 0)
            {
                return(compressedModels);
            }

            var models = DecompressModels(compressedModels, query.Graph, true);

            return(models);
        }
        public override sealed object First(Query <TModel> query)
        {
            var whereCompressed = EncryptWhere(query.Where);
            var orderCompressed = EncryptOrder(query.Order);

            var appenedQuery = new Query <TModel>(query);

            appenedQuery.Where = whereCompressed;
            appenedQuery.Order = orderCompressed;

            var encryptedModels = (TModel)(NextProvider.Query(appenedQuery));

            if (encryptedModels == null)
            {
                return(null);
            }

            var model = DecryptModel(encryptedModels, query.Graph, true);

            return(model);
        }