J
Jeff
Hi
..NET 2.0
I'm rewriting a method to become a static method, because FindCommentById is
called from a static method. Which gives me several compile errors
private static Comment FindCommentById(Guid id)
{
if (Comment.Id == id) <<<---- see implmentation of Id below this
method
return this; <<<--- "this" is not valid in static property
else
{
Comment parent = null;
foreach (Comment comment in Replies) <<<---- Replies is a
collection of Comments associated with a comment, not sure to write that
static
{
parent = Comment.FindCommentById(id);
}
return parent;
}
}
*****
private Guid _id;
public Guid Id
{
get { return _id; }
set { _id = value; }
}
I know that I cannot call Id from FindCommentById because Id is not static.
I tryed to make a static method as well (public static Guid Id), but that
didn't work out as well....
any suggestions?
..NET 2.0
I'm rewriting a method to become a static method, because FindCommentById is
called from a static method. Which gives me several compile errors
private static Comment FindCommentById(Guid id)
{
if (Comment.Id == id) <<<---- see implmentation of Id below this
method
return this; <<<--- "this" is not valid in static property
else
{
Comment parent = null;
foreach (Comment comment in Replies) <<<---- Replies is a
collection of Comments associated with a comment, not sure to write that
static
{
parent = Comment.FindCommentById(id);
}
return parent;
}
}
*****
private Guid _id;
public Guid Id
{
get { return _id; }
set { _id = value; }
}
I know that I cannot call Id from FindCommentById because Id is not static.
I tryed to make a static method as well (public static Guid Id), but that
didn't work out as well....
any suggestions?