Answer the question
In order to leave comments, you need to log in
How to correctly implement a descendant method to call an ancestor method?
Hello, I have the following set of classes:
class _Foo
{
public string FooField;
}
class Foo //_Foo
{
public string FooField;
public _Foo ToType()
{
var r = new _Foo();
r.FooField = this.FooField;
return r;
}
}
class _Bar : _Foo
{
public string BarField;
}
class Bar : Foo //_Bar
{
public string BarField;
public _Bar ToType()
{
var r = new _Bar();
r.BarField = this.BarField;
/// ??????
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question