Template
726 B
726 B
description, applyTo
| description | applyTo |
|---|---|
| Use when writing or modifying C# source code. Covers non-obvious defaults not caught by analyzers. | **/*.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 intests/andsamples/). - 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-generatedpartialmethods on apartial class— never log inline (e.g.,logger.LogInformation(…)).