9c0bf76a05
Playwright Tests / test (push) Has been cancelled
Added detailed instruction files for configuration, controller structure, C# standards, OCORE library usage, ImageSharp licensing, and testing. These documents define rules for settings, DI, file layout, package management, and test practices to ensure consistency and compliance during the .NET 10 migration.
1.8 KiB
1.8 KiB
applyTo
| applyTo |
|---|
| **/*.cs |
C# Coding Standards
Language & Target
- All code must be written in C# targeting .NET 10.
- The original Fuchs intranet was VB.NET; any remaining VB must be converted to C# during migration. Original VB reference lives at
D:\My Programming\PWProjects\Fuchs\Fuchs\Areas\Intranet.
Style
- Follow standard C# naming: PascalCase for classes and methods, camelCase for locals and parameters,
_camelCasefor private fields. ImplicitUsingsandNullableare enabled in the Fuchs project — honor nullable annotations and avoid redundantusingdirectives.- Prefer modern, performance-oriented features:
async/awaitfor I/O, LINQ for data manipulation, dependency injection for testability,switchexpressions, target-typednew, and collection initializers. - Only add comments when they match the existing style or explain non-obvious logic. Do not over-comment.
File Size
- Keep files to a soft limit of 400 lines (hard max 600).
- Proactively refactor larger files into smaller, focused classes/partials — this is why
IntranetControlleris split into domain partials.
Dependency Injection
- Inject dependencies via constructor (
ILogger<T>,IConfiguration, services). Do not use service-locator or static singletons in new class-level code. - Library classes accept optional loggers (
ILogger<T>?) defaulting toNullLogger<T>.Instance— seelogging.instructions.md.
Packages
- Do not upgrade
Spire.PDFbeyond8.10.5. - For builds failing because
SixLabors.ImageSharp(v4.0.0+) requires a license, seeimagesharp.instructions.mdbefore downgrading. - Keep
MailKit/MimeKitversions aligned with OCORE's referenced versions to avoidNU1605package-downgrade-as-error. - Only add or update packages when necessary; prefer existing/OCORE libraries.