Exemplo n.º 1
0
        public async Task removeSubPost(string post_id, string sub_post_id)
        {
            PostLikeManagement plm = new PostLikeManagement();
            CommentManagement  cm  = new CommentManagement();
            var post_collection    = dataContext.getConnection().GetCollection <Post>("Post");
            var filter             = Builders <Post> .Filter.Eq("_id", ObjectId.Parse(post_id));

            var update = Builders <Post> .Update.PullFilter("video_image", Builders <Post> .Filter.Eq("_id", ObjectId.Parse(sub_post_id)));

            await post_collection.UpdateOneAsync(filter, update);

            await plm.remove_post_like(sub_post_id);

            await cm.remove_post_comment(sub_post_id);
        }