示例#1
0
        public static async Task ClearOutTimeArticlesAsync(this FeedViewModel feedViewModel)
        {
            var original = feedViewModel.Articles;

            // 更新视图集合
            var temp = feedViewModel.Articles.ToList();

            temp.RemoveAll(x => x.UnRead == false && x.IsStarred == false);
            foreach (var item in temp)
            {
                feedViewModel.Articles.Remove(item);
            }

            var ClearArticles = from x in original
                                where x.UnRead == false && x.IsStarred == false
                                select x.AbstractInfo();

            await SQLiteService.RemoveArticlesAsync(ClearArticles);
        }
示例#2
0
        /// <summary>
        /// Delete All the Related Articles in DataBases.
        /// </summary>
        public static async Task RemoveRelatedArticlesAsync(this FeedViewModel feedViewModel)
        {
            await SQLiteService.RemoveArticlesAsync(feedViewModel.Articles.Select(article => article.AbstractInfo()));

            feedViewModel.Articles.Clear();
        }