0
私はMailChimpからMailChimpリストコレクションを取得しようとしています。すべてのリストを取得するためにMailChimp.netの例で表示されているようにプロセスを設定しましたが、タスクが呼び出された後にコンソールを読み込まない限り、リストが返される前に終了します。どのようにすればこの簡単な仕事がうまくいくのですか?どのように非同期タスクとMailchimp API v3.0
static void Main(string[] args)
{
AddUpdateMailChimp();
Console.Read();
}
static async void AddUpdateMailChimp()
{
lstIDs = await Get_MailChimp_Info();
for(int i = 0; i < lstIDs.Count; i++)
{
AddUpDateMailChimpAsync(lstIDs[i]);
}
}
private static async Task< List<string>> Get_MailChimp_Info()
{
var lstIDs = new List<string>();
apikey = GetApiKey() //from config file
manager = new MailChimpManager(apikey);
//............below line is where it bombs unless I use a concole.Read in the main..........//
**IEnumerable< MailChimp.Net.Models.List> mailChimpListCollection = await manager.Lists.GetAllAsyunc().ConfigureAwait(continueOnCapturedContext: false);**
............catch statements
//.......foreach loop to get the list Ids
}
を行うことができますが、私は行くことを与える、ありがとうございます。 – BillO
もう一度ありがとう、それは働いた。 – BillO