Is there any way to generify this two classes?
class Tag1{
public Tag1 Parent{get;set;}
}
class Tag2{
public Tag2 Parent{get;set;}
}
So I will have:
class Tag1 : Tag{}
class Tag2 : Tag{}
Seems no, but possible that I missed something global.
Thanks to Jon, I ended with the following solution:
class Tag1 : Tag<T> {
public T Parent {get;set;}
public T AddNew(){
return new T(){Parent = (T)this;} // This works
}
}