コード例 #1
0
        public void ShouldHaveValidAccountName()
        {
            var ats = new AzureTableSettings("altenchallengeapp", "privateKey", "VehicleDetails");

            Assert.True(!string.IsNullOrEmpty(ats.StorageAccount));
            Assert.Equal(ats.StorageAccount, "altenchallengeapp");
        }
コード例 #2
0
        public void Test1()
        {
            string storageAccount = "janonostorage";
            string storageKey     = System.Environment.GetEnvironmentVariable("storageKey");

            var osNameAndVersion = "";// System.Runtime.InteropServices.RuntimeInformation.OSDescription;

            string tableName = "testTableNetF" + osNameAndVersion;
            var    setting   = new AzureTableSettings(storageAccount, storageKey, tableName);
            var    stor      = new AzureTableStorage <TestContract>(
                new AzureTableSettings(
                    storageAccount: storageAccount,
                    storageKey: storageKey,
                    tableName: tableName));

            List <TestContract> listtest = new List <TestContract>();

            for (int i = 0; i < 20000; i++)
            {
                var t = new TestContract();
                t.PartitionKey = "_";
                t.RowKey       = i.ToString();
                listtest.Add(t);
            }
            stor.GetTableAsyncCreateIfNotExistsAsync().GetAwaiter().GetResult();
            stor.InsertReplace(listtest).GetAwaiter().GetResult();
            stor.DeleteIfExistsAsync();
        }
コード例 #3
0
 public AzureTableAccess(AzureTableSettings settings)
 => _settings = settings;
コード例 #4
0
 public AzureTableStorage(AzureTableSettings settings)
 {
     this.settings = settings;
 }
コード例 #5
0
 public AzureTableRepository(AzureTableSettings settings)
 {
     _settings     = settings;
     _partitionKey = _settings.partitionKey;
 }