Beispiel #1
0
        internal void RemoveCats(List <string> requireRemove)
        {
            foreach (var item in Posts)
            {
                item.Cats = item.Cats.Where(s => !requireRemove.Contains(s)).ToObservableCollection();
            }

            OnPostsUpdate?.Invoke();
        }
Beispiel #2
0
        internal bool RemoveRelatedPosts(string value)
        {
            int willRemovedPostsCount = Posts.Where(s => s.Cats.Contains(value)).Count();

            Posts = Posts.Where(s => !s.Cats.Contains(value)).ToList();

            OnPostsUpdate?.Invoke();

            return(willRemovedPostsCount > 0);
        }
Beispiel #3
0
        internal bool RemovePost(IEnumerable <int> ids)
        {
            int willRemovedPostsCount = Posts.Where(s => ids.Contains(s.Id)).Count();

            Posts = Posts.Where(s => !ids.Contains(s.Id)).ToList();

            OnPostsUpdate?.Invoke();

            return(willRemovedPostsCount > 0);
        }