Skip to content

Conversation

WhitWaldo
Copy link
Contributor

Description

This is a giant PR of changes across the Dapr packages to apply best practices from the transition to C# 12:

  • Use of file-based namespaces
  • Primary constructors on classes and structs (and removal of redundant fields where applicable)
  • Improvements to some records to properly use primary constructors
  • Getter expressions
  • Nullability annotations on a per-file basis
  • Use of patterns to simplify null + other checks
  • Applied method groups were applicable
  • Favor use of collection expressions

In short, this shortens a great many of the files, removes a level of nesting and simplifies the syntax with the transition to .NET 8+.

Issue reference

We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.

Please reference the issue this PR will close: #1261 #1429

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • Code compiles correctly
  • Created/updated tests
  • Extended the documentation

@WhitWaldo WhitWaldo merged commit c0d70ff into dapr:release-1.16 Apr 1, 2025
8 checks passed
@github-project-automation github-project-automation bot moved this from In review to Done in v1.16 Release Tracking Board Apr 1, 2025
@WhitWaldo WhitWaldo deleted the primary-constructors-and-qol branch April 1, 2025 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant