Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support mapping properties in foreach mappings #1364

Merged
merged 1 commit into from
Jun 27, 2024
Merged

support mapping properties in foreach mappings #1364

merged 1 commit into from
Jun 27, 2024

Conversation

latonz
Copy link
Contributor

@latonz latonz commented Jun 24, 2024

  • Uses a new body builder for enumerable-add mappings
  • Ignores all members of System.* types, these are considered mapped by the enumerable mapping itself
  • The ignored members can still be mapped manually by applying the MapPropertyAttribute
  • Constructors are resolved the same way as for regular object member mappings.
    For System.* types parameterized constructors are always preferred.
    If the source type has a known count member, it is mapped to a constructor parameter
    named count, length or capacity.
  • The EnsureCapacity statement is only generated if the count source member is not mapped to a constructor parameter

BREAKING CHANGE: Properties of collection classes are now mapped, which were not mapped before.

Closes #436

@latonz latonz self-assigned this Jun 24, 2024
@latonz latonz marked this pull request as ready for review June 27, 2024 01:30
@latonz latonz enabled auto-merge (squash) June 27, 2024 01:31
@latonz latonz requested review from TimothyMakkison and ni507 June 27, 2024 01:31
* Uses a new body builder for enumerable-add mappings
* Ignores all members of System.* types, these are considered mapped by the enumerable mapping itself
* The ignored members can still be mapped manually by applying the MapPropertyAttribute
* Constructors are resolved the same way as for regular object member mappings.
  For System.* types parameterized constructors are always preferred.
  If the source type has a known count member, it is mapped to a constructor parameter
  named count, length or capacity.
* The EnsureCapacity statement is only generated if the count source member is not mapped to a constructor parameter

BREAKING CHANGE: Properties of collection classes are now mapped, which were not mapped before.
@latonz latonz merged commit cc92662 into riok:main Jun 27, 2024
17 checks passed
@latonz latonz deleted the 436-foreach-add-mappings branch June 27, 2024 07:02
@latonz latonz changed the title feat!: support mapping properties in foreach mappings support mapping properties in foreach mappings Jun 30, 2024
@latonz latonz added the breaking-change This issue or pull request will break existing consumers label Jun 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change This issue or pull request will break existing consumers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mapperly does not fully map classes that inherit/implement Collection types.
2 participants