| name | csharp-style |
|---|---|
| description | Use for C# language level, nullable usage, and file/folder layout consistent with Contentstack.Management.Core. |
- Writing new C# code in
Contentstack.Management.Coreor test projects. - Choosing names, nullability, and structure for PRs.
- Core library uses C# 8.0 (
LangVersionincontentstack.management.core.csproj). - Nullable reference types are enabled (
Nullableisenable). Prefer explicit nullability on public APIs (?,!only when justified and consistent with existing code).
Follow existing top-level folders:
Services/— API-facing service classes by domain (stack, organization, OAuth, etc.).Models/— DTOs and domain models (includingModels/Fields/).Runtime/— pipeline, HTTP handlers, execution context.Exceptions/— SDK exception types.Abstractions/,Queryable/,Utils/— as used today.
New features should land in the same folder that similar code uses; avoid new root folders without team agreement.
- Match existing naming: PascalCase for public types and methods; private fields often camelCase with underscore prefix where already used in the file.
- Prefer
async/awaitpatterns consistent with neighboring methods when adding asynchronous APIs. - Keep XML doc comments on public surface when the rest of the type is documented that way.
- MSTest:
[TestClass],[TestMethod],[ClassInitialize]where the suite requires shared setup (see integration tests). - Use existing assertion helpers (e.g.
AssertLoggerin integration tests) where applicable.
- Do not introduce a different language version or disable nullable without an explicit team decision.
- Do not impose style rules that contradict the majority of files in the same directory.