public static void LoadSearchResults(Search search)
 {
     if (search != null)
     {
         (search.Results = GetSearchResults(search.Id)).ForEach(a => a.Search = search);
     }
 }
Example #2
0
 public static void SetSearchMatch(Search search, string targetId)
 {
     search.TargetId = targetId;
     using (var db = DatabaseFactory.GetMetaDbConnection())
     {
         db.Execute("update search set targetid = ? where id = ?", targetId, search.Id);
     }
 }
Example #3
0
        /*public static Search GetEpisodeSearch(string phrase, int parent)
        {
            using (var db = DatabaseFactory.GetMetaDbConnection())
            {
                return db.Query<Search>("select * from search where searchphrase = ? and parentid = ? and type = 'E'", phrase, parent).FirstOrDefault();
            }
        }*/

        public static void SaveSearch(Search search)
        {
            search.UpdatedDate = DateTime.Now;
            using (var db = DatabaseFactory.GetMetaDbConnection())
            {
                if (search.Id <= 0)
                    db.Insert(search);
                else
                    db.Update(search);
            }
        }
Example #4
0
 public SearchResult(int searchId, string targetId, Search search = null)
 {
     SearchId = searchId;
     TargetId = targetId;
     Search = search;
 }