Skip to content

Commit 06fa80a

Browse files
committed
Added guardrex code snippet suggestions
1 parent 74f1650 commit 06fa80a

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

.github/copilot-instructions.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ms.date: 07-29-2025
77
# Copilot Instructions for `dotnet/AspNetCore.Docs`
88

99
## Introduction
10-
This document contains repository-specific instructions for GitHub Copilot when assisting with the `dotnet/AspNetCore.Docs` repository. **Unless otherwise specified, all ".NET" references refer to modern .NET, not .NET Framework.**
10+
This document contains general and repository-specific instructions for GitHub Copilot when assisting with the `dotnet/AspNetCore.Docs` repository. **Unless otherwise specified, all ".NET" references refer to modern .NET, not .NET Framework.**
1111

1212
## General Guidelines
1313

@@ -54,12 +54,15 @@ When creating a PR for an issue:
5454
- Specific Version: `== aspnetcore-9.0`
5555

5656
### Code Snippets
57-
- For snippets **longer than 6 lines**:
58-
- Place in separate `.cs` file in a `snippets` folder next to the Markdown file
59-
- Create a subfolder named after the document
60-
- For version-specific code, include a version folder
61-
- Add a simple `.csproj` file targeting the appropriate .NET version
62-
57+
- For code snippets longer than 6 lines:
58+
1. Create a subfolder named after the document the snippet supports.
59+
1. Create a `snippets` folder inside that subfolder.
60+
1. For the code file:
61+
- If the snippet is not version-specific, place the code in a file with the appropriate extension (for example, `.cs` for C#) in the `snippets` folder.
62+
- If the snippet is version-specific:
63+
1. Create a subfolder inside the `snippets` folder named for the version (for example, `9.0` for .NET 9 or ASP.NET Core 9).
64+
1. Place the code in a file with the correct extension inside the version subfolder.
65+
1. Add a project file (`.csproj`) to the version subfolder targeting the matching .NET version, if necessary to run or build the snippet.
6366
- Reference snippets using triple-colon syntax:
6467
- **Use file-relative paths** for snippets specific to a single doc file:
6568
```

0 commit comments

Comments
 (0)