Esempio n. 1
0
        /// <inheritdoc />
        public Task <LondonTravelUser?> GetAsync(string id)
        {
            DocumentCollection collection = EnsureCollection();
            LondonTravelUser?  item       = collection.Get <LondonTravelUser?>(id);

            return(Task.FromResult(item));
        }
        /// <inheritdoc />
        public Task <T> GetAsync <T>(string id)
            where T : class
        {
            DocumentCollection collection = EnsureCollection();
            T item = collection.Get <T>(id);

            return(Task.FromResult(item));
        }
Esempio n. 3
0
        /// <inheritdoc />
        public Task <IEnumerable <LondonTravelUser> > GetAsync(Expression <Func <LondonTravelUser, bool> > predicate, CancellationToken cancellationToken)
        {
            DocumentCollection collection = EnsureCollection();

            var results = collection.Get <LondonTravelUser>()
                          .Where(predicate)
                          .AsEnumerable();

            return(Task.FromResult(results));
        }
        /// <inheritdoc />
        public Task <IEnumerable <T> > GetAsync <T>(Expression <Func <T, bool> > predicate, CancellationToken cancellationToken)
            where T : class
        {
            DocumentCollection collection = EnsureCollection();

            var results = collection.Get <T>()
                          .Where(predicate)
                          .AsEnumerable();

            return(Task.FromResult(results));
        }