Пример #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;
 }
Пример #2
0
 public Search Update(Search entity)
 {
     if (entity == null) return null;
     _searchRepository.Update(entity);
     return entity;
 }
Пример #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);
     }
 }
Пример #4
0
 public Search Insert(Search entity)
 {
     if (entity == null) return null;
     entity.SearchId = _searchRepository.Insert(entity);
     return entity;
 }
Пример #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);
     }
 }