Пример #1
0
    private async Task <string> GetTweetForSqlTable(TableEvent tableEvent)
    {
        if (tableEvent is null)
        {
            return(null);
        }

        string tweetText = null;

        switch (tableEvent.TableName)
        {
        case SourceSystems.Engagements:
            var engagement = await _engagementManager.GetAsync(tableEvent.PartitionKey.To <int>());

            tweetText = GetTweetForEngagement(engagement);
            break;

        case SourceSystems.Talks:
            var talk = await _engagementManager.GetTalkAsync(tableEvent.PartitionKey.To <int>());

            tweetText = GetTweetForTalk(talk);
            break;
        }

        return(tweetText);
    }
Пример #2
0
    private async Task <FacebookPostStatus> GetFacebookPostStatusForSqlTable(TableEvent tableEvent)
    {
        if (tableEvent is null)
        {
            return(null);
        }

        FacebookPostStatus facebookPostStatus = null;

        switch (tableEvent.TableName)
        {
        case SourceSystems.Engagements:
            var engagement = await _engagementManager.GetAsync(tableEvent.PartitionKey.To <int>());

            facebookPostStatus = GetFacebookPostStatusForEngagement(engagement);
            break;

        case SourceSystems.Talks:
            var talk = await _engagementManager.GetTalkAsync(tableEvent.PartitionKey.To <int>());

            facebookPostStatus = GetFacebookPostStatusForTalk(talk);
            break;
        }

        return(facebookPostStatus);
    }