In this post, I will create a DynamoDb table and a repository class that allows to read and update items.
DynamoDb Table
Create a new table in AWS DynamoDb called OccultTwitterBotTable
Create a Partition key called TweetId. This will be a unique number that increment for each Tweet item.
The other attributes are:
Message - The text contained within the tweet inclusind hashtags
TweetCount - The number of times the tweet has been tweeted (frequency)
ImageKey - The filename of the image to be attached to the tweet.
TwitterBotService.DAL
Open TwitterBotService.DAL project and add a class called TweetRepository. This will enscapsulate the ability for reading data from our table.
In this class we have the following methods:
GetItem - for fetching a single item giving an identifier.
GetAllItems - Get all items from the table using a scan
UpdateItem - Update attributes for an item
WaitUntilReady - Wait until the table is active
<< Sending Tweets Table of Contents Selecting a Tweet >>
No comments:
Post a Comment