J
Jeff
hi
..NET 2.0
I have posted some code below which I'm using at a webportal I'm trying to
develop. I have problems with this code at moment:
From what I understand from reading this text it assume that there is only
one record at root level, but that isn't correct. This list can have several
items at the root level. So I'm looking for a way to move to next record
within this FindCommentById. I know I could create a foreach loop or
something where FindCommentById is being called but hope istead I could put
it in this method.
private Comment FindCommentById(Guid id)
{
if (this.Id == id)
return this;
else
{
Comment parent = null;
foreach (Comment comment in Replies)
{
parent = comment.FindCommentById(id);
}
return parent;
}
}
any suggestions?
..NET 2.0
I have posted some code below which I'm using at a webportal I'm trying to
develop. I have problems with this code at moment:
From what I understand from reading this text it assume that there is only
one record at root level, but that isn't correct. This list can have several
items at the root level. So I'm looking for a way to move to next record
within this FindCommentById. I know I could create a foreach loop or
something where FindCommentById is being called but hope istead I could put
it in this method.
private Comment FindCommentById(Guid id)
{
if (this.Id == id)
return this;
else
{
Comment parent = null;
foreach (Comment comment in Replies)
{
parent = comment.FindCommentById(id);
}
return parent;
}
}
any suggestions?