Esempio n. 1
0
        /// <summary>
        /// UpSerts the user
        /// </summary>
        public RegisteredUser SaveOrUpdate(RegisteredUser entity)
        {
            if (_database.IsNew(entity))
            {
                _database.Insert(entity);
                //save the authentication details
                _database.Insert(entity.AuthDetails);
            }
            else
            {
                _database.Update(entity);
            }

            _database.Update<RegisteredUser>("SET AuthenticationDetails = @0 where UserId=@1",
                                             entity.AuthDetails.AuthenticationDetailsId, entity.UserId);
            return entity;
        }
Esempio n. 2
0
 /// <summary>
 /// Deletes a user
 /// </summary>
 /// <param name="entity"></param>
 public void Delete(RegisteredUser entity)
 {
     _database.Delete(entity);
 }
Esempio n. 3
0
        /// <summary>
        /// Adds a users personal feed to the queue for indexing
        /// </summary>
        /// <param name="user">the user to queue</param>
        public void QueueUserStreamIndex(RegisteredUser user)
        {
            //add a a new StreamIndex to the users indexes
            RetreaveIndex streamIndex = new RetreaveIndex()
                              {
                                  IndexType = IndexType.TwitterStreamIndex,
                                  Name = "Twitter Stream for " + user.UserName,
                                  Active = true,
                                  DateAdded = DateTime.Now,
                                  IndexStreamIdentifier = user.TwitterId.ToString()
                              };
            streamIndex.AssociatedUsers.Add(user);

            _indexDao.SaveOrUpdate(streamIndex);
        }