Skip to content

Add support for required init properties in object initializer mapping#56

Merged
mrtaikandi merged 1 commit intomainfrom
dev/fix-init-required-property
May 19, 2025
Merged

Add support for required init properties in object initializer mapping#56
mrtaikandi merged 1 commit intomainfrom
dev/fix-init-required-property

Conversation

@mrtaikandi
Copy link
Copy Markdown
Owner

Updated the WriteConstructorInitializer method in TypeInitializerGenerator.cs to include required properties (IsRequired) with PropertyInitializationMode.None in the determination of whether an object initializer is needed. This ensures that required properties are properly initialized even when they lack explicit initialization modes.

@mrtaikandi mrtaikandi merged commit c8b2fc8 into main May 19, 2025
1 check passed
@mrtaikandi mrtaikandi deleted the dev/fix-init-required-property branch May 19, 2025 07:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant