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

Fix issue #755 - Revert to behavior from 7.4.0 and new features #758

Merged

Conversation

DocSvartz
Copy link

@DocSvartz DocSvartz commented Jan 11, 2025

New:

  1. Mapping of the interface itself (IActive->IActive) not generate a new implementation from DynamicTypeGenerator.
  2. Mapping Derived Interface to Base Interface does not generate a new implementation from DynamicTypeGenerator

@DocSvartz DocSvartz changed the title Fix issue #755 - revert to behavior from 7.4.0 Fix issue #755 - revert to behavior from 7.4.0 and new feature Jan 11, 2025
@DocSvartz DocSvartz marked this pull request as ready for review January 11, 2025 17:28
@DocSvartz DocSvartz marked this pull request as draft January 11, 2025 18:13
@DocSvartz
Copy link
Author

DocSvartz commented Jan 12, 2025

@andrerav @lofcz

This completely emulates the logic of the Primitive adapter, which would be passed in 7.4.0 this case ( map IActivityBase -> IActivityBase).
The only question is caused by this case Base.Adapt(Derived).
But as far as I understand in 7.4.0 this also would not work. - Property Data does not receive state from Source

var targetExtention = sourceExt.Adapt<SampleInterfaceClsExtentions>();


var updExt = targetDerived.Adapt(targetExtention);
Copy link
Author

@DocSvartz DocSvartz Jan 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Base.Adapt(Derived) case

But this behavior is completely consistent with the access that the IActivityData interface itself provides - it does not have access to the Data property. If you add it, the state transfer will be carried out

@DocSvartz DocSvartz marked this pull request as ready for review January 12, 2025 03:16
@DocSvartz
Copy link
Author

Hm, It seems that in 7.4.0 only interfaces without content were processed in the primitive adapter. (IActivityBase in current sample).
Then there is another change.
Now the mapping of the interface itself (IActive->IActive) to itself also does not generate a new implementation from DynamicTypeGenerator.

@andrerav
Copy link
Contributor

@DocSvartz Please synchronize your branch and I can do a review. I'll release the current code in development as pre02, and we can release this as pre03. Sounds good?

@DocSvartz
Copy link
Author

DocSvartz commented Jan 13, 2025

@andrerav Ok

@DocSvartz DocSvartz changed the title Fix issue #755 - revert to behavior from 7.4.0 and new feature Fix issue #755 - revert to behavior from 7.4.0 and new features Jan 13, 2025
@DocSvartz
Copy link
Author

DocSvartz commented Jan 13, 2025

@andrerav I resolved the merge conflict.
Let me know if these changes are acceptable.
I would like to continue working on #723 based on this :)

@andrerav andrerav changed the title Fix issue #755 - revert to behavior from 7.4.0 and new features Fix issue #755 - Revert to behavior from 7.4.0 and new features Jan 13, 2025
@andrerav andrerav merged commit 155a723 into MapsterMapper:development Jan 13, 2025
1 check passed
@andrerav
Copy link
Contributor

Thank you @DocSvartz!

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.

2 participants