コード例 #1
0
ファイル: SearchLogic.cs プロジェクト: jdehlin/Twitta
 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
ファイル: SearchLogic.cs プロジェクト: jdehlin/Twitta
 public Search Update(Search entity)
 {
     if (entity == null) return null;
     _searchRepository.Update(entity);
     return entity;
 }
コード例 #3
0
ファイル: SearchRepository.cs プロジェクト: jdehlin/Twitta
 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
ファイル: SearchLogic.cs プロジェクト: jdehlin/Twitta
 public Search Insert(Search entity)
 {
     if (entity == null) return null;
     entity.SearchId = _searchRepository.Insert(entity);
     return entity;
 }
コード例 #5
0
ファイル: SearchRepository.cs プロジェクト: jdehlin/Twitta
 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);
     }
 }