public void deleteProfilePost(int id) { var comments = ProfilePostComments.Where(c => c.parent.id == id).ToList(); RemoveRange(comments); Remove(GetProfilePostById(id)); SaveChanges(); }
public ProfilePostComment GetProfilePostCommentById(int i) { return(ProfilePostComments.Where(p => p.id == i).FirstOrDefault()); }
public List <ProfilePostComment> GetCommentsOnProfilePost(ProfilePost pp) { var s = ProfilePostComments.Where(pc => pc.parent == pp).ToList(); return(s); }