Simplify [DynamicData]
to not require user to specify the member type #4254
Description
Background and Motivation
Reflection call to detect if the member is property or method isn't expensive so there is no good reason to force user to have to specify member type. Besides, nowadays most people will use nameof(MemberName)
that help to guarantee the member exists.
Proposed Feature
I think the easiest and most transparent solution is probably to add a new state to the enum DynamicDataSourceType
like AutoDetect
that would be the default value. Although this is technically a breaking change, it should not have any impact for users who are using the default value or the explicit value.
Note we need to update the related code analyzer.
Alternative Designs
Deprecate enum and related ctors but that would flow to the user for no real impact.