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; }
public Search Update(Search entity) { if (entity == null) return null; _searchRepository.Update(entity); return entity; }
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); } }
public Search Insert(Search entity) { if (entity == null) return null; entity.SearchId = _searchRepository.Insert(entity); return entity; }
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); } }