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

Suppress CA1725 for generic parameters #7077

Merged
merged 1 commit into from
Dec 11, 2023

Conversation

CollinAlpert
Copy link
Contributor

When implementing or overriding a method with a generic parameter, it often makes sense to deviate from the parameters name to make it more explicit. For example:

public interface IService<TEntity>
{
    void Update(TEntity entity);
}

public class User {}

public class UserService : IService<User>
{
    public void Update(User user) {}
}

Implementing the method as public void Update(User entity) {} feels awkward.

@CollinAlpert CollinAlpert requested a review from a team as a code owner December 8, 2023 09:12
Copy link

codecov bot commented Dec 8, 2023

Codecov Report

Merging #7077 (f21fc36) into main (94955fd) will decrease coverage by 0.01%.
Report is 5 commits behind head on main.
The diff coverage is 100.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7077      +/-   ##
==========================================
- Coverage   96.43%   96.43%   -0.01%     
==========================================
  Files        1412     1412              
  Lines      336968   336980      +12     
  Branches    11143    11144       +1     
==========================================
+ Hits       324946   324956      +10     
- Misses       9218     9220       +2     
  Partials     2804     2804              

@mavasani mavasani merged commit ac84468 into dotnet:main Dec 11, 2023
14 checks passed
@CollinAlpert CollinAlpert deleted the suppress-ca1725-for-generics branch December 11, 2023 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants