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

Change IMapper visibility from private to protected #4898

Merged
merged 2 commits into from Oct 10, 2019
Merged

Change IMapper visibility from private to protected #4898

merged 2 commits into from Oct 10, 2019

Conversation

gpcaretti
Copy link
Contributor

In order to simply the extension of the AutoMapperObjectMapper, this proposal want to promote the IMapper attribute to protected.
This allows to extend the IObjectMapper without realizing a new version of Abp.

See #4882 and #4885

In order to simply the extension of the AutoMapperObjectMapper, this proposal want to promote the IMapper attribute to protected.
This allows to extend the IObjectMapper without realizing a new version of Abp.

See #4882 and #4885
@ryancyq
Copy link
Contributor

ryancyq commented Oct 3, 2019

@gpcaretti not sure how useful it would be to make mapper a protected property.

I would imagine if you want to extend default abp object mapper, you would need to create custom object mapper class (and extend from abp default implementation) and replace it.

Wouldn’t it the same if the developer creates a custom object mapper without extending from about default implementation ?

@@ -6,7 +6,7 @@ namespace Abp.AutoMapper
{
public class AutoMapperObjectMapper : IObjectMapper
{
private readonly IMapper _mapper;
protected readonly IMapper _mapper;
Copy link
Contributor

Choose a reason for hiding this comment

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

Nonetheless, if it is useful for developers, I think we still can lift the restriction here.

Please rename _mapper to Mapper as we use PascalCase for protected property

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Contributor

Choose a reason for hiding this comment

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

You will need to rename usage of _mapper as well.

@gpcaretti
Copy link
Contributor Author

@ryancyq said:

Wouldn’t it the same if the developer creates a custom object mapper without extending from about default implementation ?

This is reasonable, as currently the class is very simple. By the way, inheritance has its advantages of avoiding rewriting basic methods present in the ancestor.

Evaluate the code and feel free to (not) adopt it. Just let me know your decision, in order to close the PR.

@ismcagdas ismcagdas added this to the v5.0 milestone Oct 10, 2019
@ismcagdas ismcagdas merged commit 18e21d0 into aspnetboilerplate:dev Oct 10, 2019
@gpcaretti gpcaretti deleted the patch-1 branch October 10, 2019 13:51
@ismcagdas ismcagdas modified the milestones: v5.0, v4.10 Oct 14, 2019
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.

None yet

3 participants