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(); }
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); }