예제 #1
0
        private void SaveCredentials(int userId, TwitterApiCredentials userCreds)
        {
            string userName = _twitterClient.GetUserName(userCreds.AccessToken, userCreds.AccessTokenSecret);

            DeleteUserIntegrationIfExists(userId);

            _unitOfWork.UserIntegrations.Add(new UserIntegration
            {
                IntegrationTypeID = (int)IntegrationType.IntegrationTypes.Twitter,
                UserID            = userId,
                Token             = userCreds.AccessToken,
                TokenSecret       = userCreds.AccessTokenSecret,
                UserName          = userName
            });
            _unitOfWork.Commit();
        }
 public ApiTweetRepository(TwitterApiCredentials credentials)
 {
     _credentials = Auth.SetUserCredentials(credentials.ConsumerKey, credentials.ConsumerSecret,
                                            credentials.AccessToken, credentials.AccessTokenSecret);
 }
예제 #3
0
 public DefaultUnitOfWork(Cluster cluster, TwitterApiCredentials credentials)
 {
     _connection = Connection(cluster).Build();
     Tweets      = new DatabaseTweetRepository(_connection);
     ApiTweets   = new ApiTweetRepository(credentials);
 }