private async Task <int> GetEngagementCountAsync(string url) { OpenGraphEngagement engagement = null; await _errors.LogAsync($"{nameof(EngagementCountClient)}.{nameof(GetEngagementCountAsync)}({nameof(url)} = {url})", async() => { engagement = await _facebook.GetEngagementAsync(url); }); if (engagement != null) { return(engagement.TotalEngagementCount); } else { return(0); } }
public async Task <OpenGraphEngagement> GetEngagementAsync(string url) { OpenGraphEngagement engagement = (await GetAsync <OpenGraphUrl>($"?id={url}&fields=engagement")).Engagement; return(engagement); }