-
Couldn't load subscription status.
- Fork 610
.NET: Inline const values in samples where used only once #1387
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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 inlines constant string literals in sample code where they are only used once, improving code simplicity and readability by removing unnecessary constant declarations.
- Removes
conststring declarations for agent names and instructions - Inlines these values directly at their single usage points
- Uses named parameters to improve clarity when passing inline values
Reviewed Changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| FoundryAgent_Hosted_MCP/Program.cs | Inlined AgentName and AgentInstructions constants in agent creation |
| Agent_Step16_ChatReduction/Program.cs | Inlined JokerName and JokerInstructions constants in agent options |
| Agent_Step15_Plugins/Program.cs | Inlined AgentName and AgentInstructions constants in agent creation |
| Agent_Step10_AsMcpTool/Program.cs | Inlined JokerName, JokerDescription, and JokerInstructions constants |
| Agent_Step09_DependencyInjection/Program.cs | Inlined constants and added named parameters for clarity |
| Agent_Step08_Observability/Program.cs | Inlined constants and added named parameters in agent creation |
| Agent_Step07_3rdPartyThreadStorage/Program.cs | Inlined constants in agent options configuration |
| Agent_Step06_PersistedConversations/Program.cs | Inlined constants and added named parameters in agent creation |
| Agent_Step02_MultiturnConversation/Program.cs | Inlined constants and added named parameters in agent creation |
| Agent_Step01_Running/Program.cs | Inlined constants and added named parameters in agent creation |
| Agent_OpenAI_Step01_Running/Program.cs | Inlined constants and added named parameters in agent creation |
| Agent_With_OpenAIResponses/Program.cs | Inlined constants and added named parameters in agent creation |
| Agent_With_OpenAIChatCompletion/Program.cs | Inlined constants and added named parameters in agent creation |
| Agent_With_Ollama/Program.cs | Inlined constants and added named parameters in agent creation |
| Agent_With_ONNX/Program.cs | Inlined constants and added named parameters in agent creation |
| Agent_With_AzureOpenAIResponses/Program.cs | Inlined constants and added named parameters in agent creation |
| Agent_With_AzureOpenAIChatCompletion/Program.cs | Inlined constants and added named parameters in agent creation |
| Agent_With_AzureFoundryModel/Program.cs | Inlined constants and added named parameters in agent creation |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Motivation and Context
#1163
Description
Contribution Checklist