-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Description
Is your feature request related to a problem? Please describe.
Hi, I was trying to add the [AllArgsConstructor] to a class inheriting another, and the constructor generated only uses the current class' properties. Is this expected ?
Describe the solution you'd like
The corresponding properties of the base class should be included in the constructor, or at least have a flag parameter ?
Describe alternatives you've considered
None, just write the constructors myself in this particular case.
Additional context
Here is the code that fails to generate what I was expecting
[AllArgsConstructor(MemberType = MemberType.Property, AccessTypes = AccessTypes.Public)]
public partial class BaseModel
{
public string Number { get; set; }
public string Label { get; set; }
}
[AllArgsConstructor(MemberType = MemberType.Property, AccessTypes = AccessTypes.Public)]
public partial class ExtendedModel : BaseModel
{
public string? Summary { get; set; }
public string? Result{ get; set; }
}The generated code is:
public partial class ExtendedModel
{
public ExtendedModel (string? summary, string? result)
{
this.Summary = summary;
this.Result = result;
}
}I would expect a constructor with 4 parameters, optionally calling base() with the parameters of the base class.
Metadata
Metadata
Assignees
Labels
No labels