[Solved] If abstract base class contains parameterised constructor (and derived does not) why can’t it be used? [duplicate]


No, you can’t.

It’s a limitation that says ‘each derived class should use (implicitly or explicitly) at least one constructor from base class.

In your example, your child class implicitly has parameterless constructor which implicitly uses parameterless constructor from base.

So, you need to: either setup parameretised constructor in every derived class or delele this constructor from base class.

Or, you can try something like that:

public class AttributeOption : DomainModelBase<AttributeOptionData>
{
    public AttributeOption(AttributeOptionData data) : base(data) { }
}

That’s not what you exactly want, but that what we have.

solved If abstract base class contains parameterised constructor (and derived does not) why can’t it be used? [duplicate]