Skip to content

Conversation

@shethaadit
Copy link
Contributor

@shethaadit shethaadit commented Oct 28, 2024

Summary

In this PR, I have

  • Clarified partial class usage with examples split across multiple files to reflect real-world scenarios.
  • Updated Employee and Coords examples to demonstrate the recommended multi-file structure.
  • Added guidance within documentation to prevent confusion and enhance code readability.
  • Reinforced best practices for managing large classes, helping developers avoid common pitfalls and potential breaking issues.

Fixes #43217


Internal previews

📄 File 🔗 Preview link
docs/csharp/programming-guide/classes-and-structs/partial-classes-and-methods.md docs/csharp/programming-guide/classes-and-structs/partial-classes-and-methods

@shethaadit shethaadit requested review from a team and BillWagner as code owners October 28, 2024 22:20
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates PR is created by someone from the .NET community. label Oct 28, 2024
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.

Thanks @shethaadit

I had one formatting suggestion. I'll merge that and then merge this PR after the build finishes.

@BillWagner BillWagner enabled auto-merge (squash) October 29, 2024 13:41
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.

Hi @shethaadit

The CI build failed because there's two Main methods. You'll need to declare one in the csproj file to specify which is meant as the entry point.

auto-merge was automatically disabled October 29, 2024 16:53

Head branch was pushed to by a user without write access

@shethaadit shethaadit requested a review from BillWagner October 29, 2024 19:22
@BillWagner
Copy link
Member

Thanks @shethaadit

I'll :shipit: now.

@BillWagner BillWagner merged commit 8b79865 into dotnet:main Oct 30, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-contribution Indicates PR is created by someone from the .NET community.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Emphasize in the examples that partial classes should (?) / can be in different files

2 participants