示例#1
0
 public async Task DeleteAsync <T>() where T : SmsSenderSettingsBase, new()
 {
     var partitionKey = SmsSenderSettingsEntity.GeneratePartitionKey();
     var defaultValue = SmsSenderSettingsBase.CreateDefault <T>();
     var rowKey       = SmsSenderSettingsEntity.GenerateRowKey(defaultValue);
     await _tableStorage.DeleteIfExistAsync(partitionKey, rowKey);
 }
示例#2
0
        public async Task <T> GetAsync <T>() where T : SmsSenderSettingsBase, new()
        {
            var partitionKey = SmsSenderSettingsEntity.GeneratePartitionKey();
            var defaultValue = SmsSenderSettingsBase.CreateDefault <T>();
            var rowKey       = SmsSenderSettingsEntity.GenerateRowKey(defaultValue);
            var entity       = await _tableStorage.GetDataAsync(partitionKey, rowKey);

            return(entity == null ? defaultValue : entity.GetSmsSenderSettings <T>());
        }