Esempio n. 1
0
        public static void Main(string[] args)
        {
            // Get the configuration
            var configuration = BuildConfiguration();

            var store = new Store <MyEntity>();

            store.Add(new MyEntity()
            {
                Id = 1
            });

            string cacheConnectionString = configuration["redisConnectionString"];

            ConnectionMultiplexer connection = ConnectionMultiplexer.Connect(cacheConnectionString);

            var repo   = new CacheAsideRepository <MyEntity>(store, connection.GetDatabase());
            var entity = repo.GetById(1);

            entity = repo.GetById(1);
            repo.Update(entity);
            entity = repo.GetById(1);

            Console.ReadLine();
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            var store = new Store <MyEntity>();

            store.Add(new MyEntity()
            {
                Id = 1
            });

            string cacheConnectionString = "";

            ConnectionMultiplexer connection = ConnectionMultiplexer.Connect(cacheConnectionString);

            var repo   = new CacheAsideRepository <MyEntity>(store, connection.GetDatabase());
            var entity = repo.GetById(1);

            entity = repo.GetById(1);
            repo.Update(entity);
            entity = repo.GetById(1);
        }