Skip to content

Conversation

@deepsource-autofix
Copy link
Contributor

This PR refactors multiple object instantiation sites to leverage C# target-typed new expressions, removing redundant type names from the right-hand side when the type is already declared on the left. All occurrences of new Type(...) or new Type() have been updated to new(...) or new() respectively, improving code readability and reducing verbosity.

  • Type can be dropped from the declaration's RHS when explicitly mentioned in the LHS: In the original code, various constructors repeated the type on the right-hand side even though the variable or property type was clearly specified on the left. This change replaces those redundant instantiations with target-typed new expressions (new(...) or new()), streamlining the code and adhering to modern C# best practices.

This Autofix was generated by AI. Please review the change before merging.

This PR refactors multiple object instantiation sites to leverage C# target-typed `new` expressions, removing redundant type names from the right-hand side when the type is already declared on the left. All occurrences of `new Type(...)` or `new Type()` have been updated to `new(...)` or `new()` respectively, improving code readability and reducing verbosity.

- Type can be dropped from the declaration's RHS when explicitly mentioned in the LHS: In the original code, various constructors repeated the type on the right-hand side even though the variable or property type was clearly specified on the left. This change replaces those redundant instantiations with target-typed `new` expressions (`new(...)` or `new()`), streamlining the code and adhering to modern C# best practices.

> This Autofix was generated by AI. Please review the change before merging.
@deepsource-io
Copy link

deepsource-io bot commented Sep 18, 2025

Here's the code health analysis summary for commits f32cb6e..42a2b96. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource SQL LogoSQL✅ SuccessView Check ↗
DeepSource Docker LogoDocker✅ SuccessView Check ↗
DeepSource C# LogoC#✅ Success
🎯 13 occurences resolved
View Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

@StuartFerguson StuartFerguson merged commit 8b7949b into master Sep 18, 2025
11 of 13 checks passed
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.

2 participants