Ejemplo n.º 1
0
        public override void ImportData(Data.IAssembler assembler)
        {
            IDatabase     cache = connectionMultiplexer.GetDatabase();
            List <object> data  = assembler.GetData();

            cache.StringSet("airlines", data.Select(d => JsonConvert.SerializeObject(d)).ToString());
        }
        public override void ImportData(Data.IAssembler assembler)
        {
            var manager = new RedisManagerPool("localhost:6379");

            using (var client = manager.GetClient())
            {
                List <object> data = assembler.GetData();
                client.AddRangeToList("airlines", data.Select(d => JsonConvert.SerializeObject(d)).ToList());
            }
        }
        public override void ImportData(Data.IAssembler assembler)
        {
            IDatabase     cache = connectionMultiplexer.GetDatabase();
            List <object> data  = assembler.GetData();

            for (int iCounter = 0; iCounter < data.Count; iCounter++)
            {
                if (data[iCounter] is Arrival arrival)
                {
                    cache.StringSet("arrivals", JsonConvert.SerializeObject(arrival));
                }
                else if (data[iCounter] is Departure departure)
                {
                    cache.StringSet("departures", JsonConvert.SerializeObject(departure));
                }
            }
        }
Ejemplo n.º 4
0
        public override void ImportData(Data.IAssembler assembler)
        {
            var manager = new RedisManagerPool("localhost:6379");

            using (var client = manager.GetClient())
            {
                List <object> data = assembler.GetData();

                for (int iCounter = 0; iCounter < data.Count; iCounter++)
                {
                    if (data[iCounter] is Arrival arrival)
                    {
                        client.AddItemToList("arrivals", JsonConvert.SerializeObject(arrival));
                    }
                    else if (data[iCounter] is Departure departure)
                    {
                        client.AddItemToList("departures", JsonConvert.SerializeObject(departure));
                    }
                }
            }
        }