Template
✨ Adds project guidelines and conventions for Github Copilot
Introduces detailed instructions for ASP.NET API, C#, Docker, MSBuild, testing, and library creation. These guidelines aim to standardize development practices and improve code quality across the project.
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
---
|
||||
description: "Use when writing or modifying C# source code. Covers non-obvious defaults not caught by analyzers."
|
||||
applyTo: "**/*.cs"
|
||||
---
|
||||
# C# Conventions
|
||||
|
||||
Code style is enforced by `.editorconfig`, `.globalconfig`, and StyleCop analyzers — do not restate their rules.
|
||||
|
||||
## Non-Obvious Defaults
|
||||
|
||||
- XML doc comments required on public API in `src/` (suppressed in `tests/` and `samples/`).
|
||||
- Avoid `null!` (null-forgiving operator) — fix the nullability flow instead of suppressing the warning.
|
||||
|
||||
## Patterns
|
||||
|
||||
- Prefer **records** for DTOs, value objects, and other immutable data carriers.
|
||||
- Use `LoggerMessage`-generated `partial` methods on a `partial class` — never log inline (e.g., `logger.LogInformation(…)`).
|
||||
Reference in New Issue
Block a user