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