コード例 #1
0
        public async override void Execute(object parameter)
        {
            var forumEntity = (ForumEntity)parameter;

            using (var db = new FavoriteForumContext())
            {
                db.Delete(forumEntity);
                await db.SaveChangesAsync();

                Locator.ViewModels.MainForumsPageVm.GetFavoriteForums();
            }
        }
コード例 #2
0
        public async override void Execute(object parameter)
        {
            var forumEntity = (ForumEntity)parameter;

            if (Locator.ViewModels.MainForumsPageVm.FavoriteForumGroupList.First().ForumList.Any(forum => forum.ForumId == forumEntity.ForumId))
            {
                return;
            }
            using (var db = new FavoriteForumContext())
            {
                db.Add(forumEntity);
                await db.SaveChangesAsync();

                Locator.ViewModels.MainForumsPageVm.GetFavoriteForums();
            }
        }