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

Simplify [DynamicData] to not require user to specify the member type #4254

Closed
Evangelink opened this issue Dec 6, 2024 · 0 comments · Fixed by #4340
Closed

Simplify [DynamicData] to not require user to specify the member type #4254

Evangelink opened this issue Dec 6, 2024 · 0 comments · Fixed by #4340

Comments

@Evangelink
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants