示例#1
0
    public void deleteProfilePost(int id)
    {
        var comments = ProfilePostComments.Where(c => c.parent.id == id).ToList();

        RemoveRange(comments);
        Remove(GetProfilePostById(id));
        SaveChanges();
    }
示例#2
0
    public void makeProfilePostComment(string post, String author, int id)
    {
        var msgAuthor = GetUserByName(author);
        var msgParent = GetProfilePostById(id);

        ProfilePostComments.Add(new ProfilePostComment {
            post = post, parent = msgParent, author = msgAuthor
        });
        SaveChanges();
    }
示例#3
0
 public ProfilePostComment GetProfilePostCommentById(int i)
 {
     return(ProfilePostComments.Where(p => p.id == i).FirstOrDefault());
 }
示例#4
0
    public List <ProfilePostComment> GetCommentsOnProfilePost(ProfilePost pp)
    {
        var s = ProfilePostComments.Where(pc => pc.parent == pp).ToList();

        return(s);
    }