Esempio n. 1
0
        public async Task <string> RegisterAsync(ITweetCash tweetCash)
        {
            var newItem = TweetCash.Create(tweetCash);
            await _tableStorage.InsertAsync(newItem);

            return(newItem.TweetId);
        }
Esempio n. 2
0
 public async Task CreateOrUpdateAsync(IEnumerable <ITweetCash> tweetsCash)
 {
     await _tableStorage.InsertOrReplaceAsync(tweetsCash.Select(t => new TweetCash()
     {
         PartitionKey = t.AccountId,
         RowKey       = TweetCash.GenerateRowKey(t.Date, t.TweetId),
         Title        = t.Title,
         TweetId      = t.TweetId,
         UserImage    = t.UserImage,
         Date         = t.Date.ToUniversalTime(),
         Author       = t.Author,
         TweetImage   = t.TweetImage,
         AccountId    = t.AccountId,
         TweetJSON    = t.TweetJSON
     }));
 }
Esempio n. 3
0
        public async Task <IEnumerable <ITweetCash> > GetAsync(string accountId)
        {
            var partitionKeyCond = TableQuery.GenerateFilterCondition(nameof(TweetCash.PartitionKey),
                                                                      QueryComparisons.Equal, TweetCash.GeneratePartitionKey(accountId));

            return(await _tableStorage.ExecuteQueryWithPaginationAsync(
                       new TableQuery <TweetCash>()
            {
                FilterString = partitionKeyCond
            },
                       new PagingInfo()
            {
                ElementCount = 1000
            }));
        }
Esempio n. 4
0
 public async Task CreateAsync(ITweetCash tweetCash)
 {
     var newItem = TweetCash.Create(tweetCash);
     await _tableStorage.InsertAsync(newItem);
 }