Example #1
0
 public Search Insert(Search entity, long lastTweetId, DateTime searchDateTime)
 {
     Insert(entity);
     if (entity.SearchId != 0)
     {
         _searchHistoryLogRepository.Insert(new SearchHistoryLog {SearchId = entity.SearchId, LastTweetId = lastTweetId, SearchDate = searchDateTime});
     }
     return entity;
 }
Example #2
0
 public Search Update(Search entity)
 {
     if (entity == null) return null;
     _searchRepository.Update(entity);
     return entity;
 }
Example #3
0
 public int Insert(Search entity)
 {
     using (_connection = Utilities.Database.GetProfiledOpenConnection())
     {
         const string query = "INSERT INTO Searches (Title, AllOfTheseWords, ThisExactPhrase, AnyOfTheseWords, NoneOfTheseWords, NearThisPlace, Radius, ResultType) " +
                              "VALUES (@Title, @AllOfTheseWords, @ThisExactPhrase, @AnyOfTheseWords, @NoneOfTheseWords, @NearThisPlace, @Radius, @ResultType)";
         return _connection.Execute(query, entity);
     }
 }
Example #4
0
 public Search Insert(Search entity)
 {
     if (entity == null) return null;
     entity.SearchId = _searchRepository.Insert(entity);
     return entity;
 }
Example #5
0
 public void Update(Search entity)
 {
     using (_connection = Utilities.Database.GetProfiledOpenConnection())
     {
         const string query = "UPDATE Searches SET Title = @Title, AllOfTheseWords = @AllOfTheseWords, ThisExactPhrase = @ThisExactPhrase, AnyOfTheseWords = @AnyOfTheseWords, NoneOfTheseWords = @NoneOfTheseWords, NearThisPlace = @NearThisPlace, Radius = @Radius, ResultType = @ResultType WHERE SearchId = @SearchId";
         _connection.Execute(query, entity);
     }
 }