ForCtorParam should be inherited #4313
Replies: 2 comments 9 replies
-
A PR is welcome. |
Beta Was this translation helpful? Give feedback.
9 replies
-
This discussion has been automatically locked since there has not been any recent activity after it was closed. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
When using records (or a class with a constructor), when you define ForCtorParam in a base class, you also need to specify it in every derived class again. I understand that derived classes could have less or more constructor parameters, but I think it's a safe assumption to reuse the same constructor param mapping as the base class if the name and type of the parameter matches.
Otherwise, this makes using inheritance with constructors quite cumbersome, as I have to repeat the same mappings over and over.
Source/destination types
Mapping configuration
Version: 12.0.1
Expected behavior
Above configuration should be valid, understanding the the same mapping done in the base class for the Visibility parameter can be reused again in the derived type.
Actual behavior
Above configuration fails the validation, force me to repeat the ForCtorParam in the base class in each of the derived ones.
Steps to reproduce
https://dotnetfiddle.net/i8nhRQ
Beta Was this translation helpful? Give feedback.
All reactions