0
在我的項目中,我想創建一個處理所有髒Azure工作的類,並提供一個乾淨的界面,我只需提供存儲的實體。爲什麼我不能創建一個異步構造函數?
我試着在我的構造函數中創建表,但它不允許它。我無法弄清楚這種結構有什麼問題。
任何想法或替代辦法嗎?
乾杯,亞歷克斯
using System;
using System.Threading.Tasks;
using Microsoft.Azure;
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Table;
namespace MyProject
{
public class AzureStorage
{
public async Task<AzureStorage> AzureStorage()
{
table = await CreateTableAsync("mytable");
}
CloudTable table { get; set; }
}
}
會做,謝謝! – AlexandreG