internal void RemoveCats(List <string> requireRemove) { foreach (var item in Posts) { item.Cats = item.Cats.Where(s => !requireRemove.Contains(s)).ToObservableCollection(); } OnPostsUpdate?.Invoke(); }
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); }
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); }