Skip to main content

umbraco-nullable-reference-types

Write and fix Umbraco 17+ C# and Razor code under C# nullable reference types (NRT), which Umbraco has enabled since v10. Covers which Umbraco APIs return null (Value<T>() returning T?, Parent, GetById, Models Builder properties, media and picker values), the TryGetUmbracoContext / TryGetUmbracoHelper accessor pattern with [NotNullWhen] flow analysis, Razor null handling, and turning on <Nullable>enable</Nullable> with WarningsAsErrors=nullable without scattering the null-forgiving operator. Use this when the user mentions "nullable reference types", "NRT", CS8602 / CS8600 / CS8603 / CS8618 warnings in an Umbraco project, "possible null reference", "dereference of a possibly null reference", "null-forgiving operator", or asks to make Umbraco code null-safe. SKIP: non-Umbraco projects, Umbraco versions before 10, and general C# NRT questions with no Umbraco API involved.

Informations de source

Dépôt
umbraco/Umbraco-CMS-Implementation-Skills
Dernière activité de la source
21 octobre 2026 à 08:57
Langue détectée de SKILL.md
anglais
Étoiles
7
Forks
8

Options d'installation

Le prompt qui vérifie d'abord la source est sélectionné par défaut. Vous pouvez passer à une commande directe ou télécharger une copie locale.

Vérifiez les fichiers source

Lisez SKILL.md et les fichiers associés affichés par SkillsMP avant de décider de l'installer.

Explorateur de fichiers
14 fichiers

Affichage de SKILL.md

SKILL.md
Instructions source · Aperçu en lecture seule
nameumbraco-nullable-reference-types
descriptionWrite and fix Umbraco 17+ C# and Razor code under C# nullable reference types (NRT), which Umbraco has enabled since v10. Covers which Umbraco APIs return null (Value<T>() returning T?, Parent, GetById, Models Builder properties, media and picker values), the TryGetUmbracoContext / TryGetUmbracoHelper accessor pattern with [NotNullWhen] flow analysis, Razor null handling, and turning on <Nullable>enable</Nullable> with WarningsAsErrors=nullable without scattering the null-forgiving operator. Use this when the user mentions "nullable reference types", "NRT", CS8602 / CS8600 / CS8603 / CS8618 warnings in an Umbraco project, "possible null reference", "dereference of a possibly null reference", "null-forgiving operator", or asks to make Umbraco code null-safe. SKIP: non-Umbraco projects, Umbraco versions before 10, and general C# NRT questions with no Umbraco API involved.