예제 #1
0
        public async Task <IEnumerable <Articulos> > GetArticulosByRevista(string revista)
        {
            var compartimossService = new CompartiMossService();

            _repository = await compartimossService.SearchArticles(revista);

            return(_repository.Where(x => x.NumeroRevista.Equals(revista)));
        }
예제 #2
0
        public async Task <IEnumerable <Articulos> > GetArticulosByAutor(string autor)
        {
            var compartimossService = new CompartiMossService();

            _repository = await compartimossService.SearchArticlesByAutor(autor);

            return(_repository);
        }
        public async Task <Revista> GetRevistaByTitle(string name)
        {
            if (_repository == null)
            {
                var compartimossService = new CompartiMossService();
                _repository = await compartimossService.SearchNumbers();

                if (canRedis)
                {
                    using (var redisClient = new RedisClient(urlRedis, 6379))
                    {
                        redisClient.Set <IEnumerable <Revista> >("revista", _repository);
                    }
                }
            }
            return(_repository.Where(x => x.Numero.Equals(name)).FirstOrDefault());
        }
        public async Task <IEnumerable <Revista> > GetRevistas()
        {
            if (_repository == null)
            {
                var compartimossService = new CompartiMossService();
                _repository = await compartimossService.SearchNumbers();

                if (canRedis)
                {
                    using (var redisClient = new RedisClient(urlRedis, 6379))
                    {
                        redisClient.Set <IEnumerable <Revista> >("revista", _repository);
                    }
                }
            }
            return(_repository);
        }
        public async Task <Autor> GetAutorByName(string name)
        {
            if (!_collection.Any())
            {
                var compartimossService = new CompartiMossService();
                _collection = await compartimossService.SearchAuthors();

                if (canRedis)
                {
                    using (var redisClient = new RedisClient(urlRedis, 6379))
                    {
                        redisClient.StoreAll(_collection);
                    }
                }
            }
            return(_collection.Where(x => x.Name.Equals(name)).FirstOrDefault());
        }
        public async Task <IEnumerable <Autor> > GetAllAutor()
        {
            if (!_collection.Any())
            {
                var compartimossService = new CompartiMossService();
                _collection = await compartimossService.SearchAuthors();

                if (canRedis)
                {
                    using (var redisClient = new RedisClient(urlRedis, 6379))
                    {
                        redisClient.StoreAll(_collection);
                    }
                }
            }

            return(_collection);
        }