Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/http-client-csharp/.tspd/docs/customization.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Customizing the generated code

## Before You Customize

Before customizing generated code, consider whether your change should be made in TypeSpec (`client.tsp`) instead. TypeSpec customizations are cleaner and survive regeneration. See the [TypeSpec Client Customizations Reference](https://github.com/Azure/azure-sdk-tools/blob/main/eng/common/knowledge/customizing-client-tsp.md) for available decorators like `@@clientName`, `@@access`, etc.
Copy link
Contributor

Choose a reason for hiding this comment

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

TypeSpec customizations are cleaner and survive regeneration

Customizations also survive regeneration. We can instead say that TypeSpec customizations allow you to apply changes to multiple languages at once and they are also more discoverable for other languages. They also live right near the spec bringing us more to a single source of truth.


Use C# code customizations (partial classes) when TypeSpec cannot express the behavior you need.

## Make a model internal

Define a class with the same namespace and name as generated model and use the desired accessibility.
Expand Down
Loading