Skip to content

Commit cc8ca47

Browse files
committed
lint
1 parent 03a48c7 commit cc8ca47

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

docs/csharp/fundamentals/null-safety/resolve-warnings.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ You have several ways to address it. Pick the one that best matches your design
105105
:::code language="csharp" source="snippets/resolve-warnings/Program.cs" id="InitializedMember":::
106106

107107
> [!TIP]
108-
> Choose this technique only when the type has a genuinely good default value: one that's a valid, fully-functional instance for callers to consume. Examples include empty collections. Don't invent a *sentinel* (a placeholder value such as <xref:System.String.Empty?displayProperty=nameWithType>, "N/A"`, `"unknown"`, or `-1` that you treat as "no value") to stand in for `null`: it silences the warning, but every caller has to know about and check for the sentinel, and the type system can't help. When no good default exists, make the property nullable instead.
108+
> Choose this technique only when the type has a genuinely good default value: one that's a valid, fully-functional instance for callers to consume. Examples include empty collections. Don't invent a *sentinel* (a placeholder value such as <xref:System.String.Empty?displayProperty=nameWithType>, `"N/A"`, `"unknown"`, or `-1` that you treat as "no value") to stand in for `null`: it silences the warning, but every caller has to know about and check for the sentinel, and the type system can't help. When no good default exists, make the property nullable instead.
109109
110110
**Make the property nullable.** When the value really might be missing, change the type to nullable:
111111

0 commit comments

Comments
 (0)