Beispiel #1
0
        static void Main(string[] args)
        {
            CloudConfig.RegisterConfigurations();

            _distributedCache = CloudConfig.GetService <IDistributedCache>()
                                ?? throw new ArgumentNullException(nameof(IDistributedCache));

            _connectionMultiplexer = CloudConfig.GetService <IConnectionMultiplexer>()
                                     ?? throw new ArgumentNullException(nameof(IConnectionMultiplexer));
            _redisServer = _connectionMultiplexer.GetDatabase();

            SimplePingCommand();
            SimpleGetSessionState();
            SetSessionState();
            GetSessionState();
            GetClientList();
            StoreObjectSessionState();
            RetrieveObjectSessionState();

            _connectionMultiplexer.Dispose();

            SetCache();
            GetCache();
            StoreObjectCache();
            RetrieveObjectCache();

            Console.WriteLine("Press any key to continue...");
            Console.ReadLine();
        }
Beispiel #2
0
 static RedisConfig()
 {
     _connectionMultiplexer = CloudConfig.GetService <IConnectionMultiplexer>()
                              ?? throw new ArgumentNullException(nameof(IConnectionMultiplexer));
 }