Questions tagged [nullable-reference-types]

For questions related to C# 8's nullable reference types.

Filter by
Sorted by
Tagged with
1 vote
0 answers
56 views

Razor Pages PageModel Initialization When Sharing Data Between OnGet and OnPost

I'm trying to find the best way to initialize some PageModel, avoiding repetition and preventing nullable reference types warnings. Please see the below example. Is ...
user276847's user avatar
7 votes
2 answers
3k views

Filter out nulls from sequence of nullables to produce sequence of non-nullables

While introducing nullable reference types to our enterprise application's codebase, I found that we are often using LINQ on sequences of nullable reference types where we filter out the nulls using <...
Palec's user avatar
  • 171
-2 votes
1 answer
74 views

Check nullability vs throw NullExceptions [closed]

I have been trying to understand the difference between two approaches and have always got confused so thought of asking this question here. Consider following code, ...
touchofevil's user avatar
1 vote
1 answer
132 views

Conventional C# for LinkedList with (non-)nullable references + xunit tests

I'm new to C# and would appreciate any feedback you might have on the following doubly-linked list implementation, particularly WRT the following language features: Exception handling Debug.Assert ...
Manningham's user avatar