Skip to content

Conversation

@gewarren gewarren marked this pull request as ready for review September 30, 2025 17:53
@gewarren gewarren requested a review from a team as a code owner September 30, 2025 17:53
Copy link
Member

@BillWagner BillWagner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great. I had a few optional suggestions and then, let's :shipit:

@Copilot Copilot AI review requested due to automatic review settings October 3, 2025 19:24
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR modernizes code examples for CA (Code Analysis) rules by updating them to use contemporary C# and VB.NET syntax and patterns. The changes improve readability and demonstrate current best practices while maintaining the same educational purpose.

  • Replaces older syntax with modern equivalents (collection expressions, target-typed new expressions, primary constructors)
  • Updates data access examples from SQL Server to OLE DB with appropriate platform attributes
  • Removes unnecessary code and simplifies class implementations using modern language features

Reviewed Changes

Copilot reviewed 36 out of 36 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
CA2235 snippet files Modernized serialization example with primary constructor and auto-properties
CA2100 snippet files Updated SQL examples to use OLE DB with platform-specific attributes
CA1816 snippet files Replaced SQL connection examples with MemoryStream for simpler disposal pattern
CA1806 snippet files Modernized method result handling examples with null-conditional operators
CA1045 snippet files Extensively modernized ref/out parameter examples with records and switch expressions
Various CA rule snippets Applied target-typed new expressions, collection expressions, and simplified syntax
Documentation files Updated example structure and minor text improvements
.editorconfig files Added CA2100 severity configuration

@gewarren gewarren enabled auto-merge (squash) October 3, 2025 19:29
@gewarren gewarren merged commit 5ce6253 into dotnet:main Oct 3, 2025
8 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