/// <summary> /// 清除所有数据 /// </summary> /// <returns></returns> public Task <int> ClearAllData() { return(LocalDatabaseHelper <SearchedItem> .ClearDatabase()); }
/// <summary> /// 查找所有搜索历史 /// </summary> /// <returns></returns> public Task <List <SearchedItem> > GetAllSearchedItem() { return(LocalDatabaseHelper <SearchedItem> .GetAllItems()); }
/// <summary> /// 删除所有搜索历史 /// </summary> /// <returns></returns> public Task <int> DeleteAllSearchedItem() { return(LocalDatabaseHelper <SearchedItem> .DeleteAllItems()); }
/// <summary> /// 插入搜索历史 /// </summary> /// <param name="searchedItem"></param> /// <returns></returns> public Task <int> InsertSearchedItem(SearchedItem searchedItem) { //Database.DeleteAllAsync<SearchedItem>(); //先清空 return(LocalDatabaseHelper <SearchedItem> .InsertOrReplaceAsync(searchedItem)); }