本文整理汇总了C#中BaseClient.ExecuteTaskAsync方法的典型用法代码示例。如果您正苦于以下问题:C# BaseClient.ExecuteTaskAsync方法的具体用法?C# BaseClient.ExecuteTaskAsync怎么用?C# BaseClient.ExecuteTaskAsync使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseClient
的用法示例。
在下文中一共展示了BaseClient.ExecuteTaskAsync方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetAccountInfoAsync
/// <summary>
/// Returns the information for a given Eloqua account.
/// </summary>
/// <param name="site">
/// The site for accessing Eloqua services, this is tipically the company name. This is the same used to access
/// Eloqua website.
/// </param>
/// <param name="user">The username. This is the same used to access Eloqua website.</param>
/// <param name="password">The password of the account. This is the same used to access Eloqua website.</param>
/// <returns>The information for the given account. It is directly retrieved from Eloqua.</returns>
public static async Task<AccountInfo> GetAccountInfoAsync(string site, string user, string password)
{
var client = new BaseClient(site, user, password, BulkUrl.Login);
IRestResponse<AccountInfo> responseAccountInfo =
await client.ExecuteTaskAsync<AccountInfo>(new RestRequest("id", Method.GET));
return responseAccountInfo.Data;
}