Answer the question
In order to leave comments, you need to log in
Preventing an ancestor constructor from being called. How?
Hello. Got a question. To get started, sample code:
class BaseC
{
public BaseC()
{
// Do something
}
}
class DerivedC : BaseC
{
public DerivedC()
{
// Some code
}
}
Answer the question
In order to leave comments, you need to log in
No way. If the ancestor constructor fails, the object will not be fully initialized. Why do you need a half-created object?
Convert the class to an interface if possible. If you have a class that doesn't require initialization, then it's not really a class.
I don't know C# so I can't really help.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question