Ejemplo n.º 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();
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }