Пример #1
0
        /// <summary>
        ///
        /// </summary>
        public Cache()
        {
            var settings = new Tools.Settings();

            _lazyConnection = new Lazy <ConnectionMultiplexer>(() => ConnectionMultiplexer.Connect(settings.CacheConnection));

            var serializer = new ProtobufSerializer();

            _bUseLocalCache = settings.UseLocalCache;

            _Cache = new StackExchangeRedisCacheClient(_lazyConnection.Value, serializer, "__");

            _Database = _Cache.Database;
        }
Пример #2
0
        /// <summary>
        /// configure the storage account connection and client
        /// </summary>
        public BaseTable(string TableName)
        {
            var settings         = new Tools.Settings();
            var connectionString = settings.StorageConnetion;

            try
            {
                var storageAccount = CloudStorageAccount.Parse(connectionString);

                CloudTableClient tableClient = storageAccount.CreateCloudTableClient();

                Table = tableClient.GetTableReference(TableName);
                Table.CreateIfNotExists();
            }
            catch (Exception ex)
            {
            }
        }