Exemplo n.º 1
0
        public async Task<Autor> GetAutorByName(string name)
        {
            if (!_collection.Any())
            {
                var compartimossService = new CompartiService();
                _collection = await compartimossService.SearchAuthors();
                using (var redisClient = new RedisClient("dockerdotnetencamina.westus.cloudapp.azure.com", 6379))
                {
                    redisClient.StoreAll(_collection);
                }
            }
            return _collection.Where(x => x.Name.Equals(name)).FirstOrDefault();

        }
Exemplo n.º 2
0
        public async Task<IEnumerable<Autor>> GetAllAutor()
        {
            if (!_collection.Any())
            {
                var compartimossService = new CompartiService();
                _collection = await compartimossService.SearchAuthors();
                using (var redisClient = new RedisClient("dockerdotnetencamina.westus.cloudapp.azure.com", 6379))
                {
                    redisClient.StoreAll(_collection);
                }
            }

            return _collection;


        }