tagged [nullable-reference-types]
How to treat ALL C# 8 nullable reference warnings as errors?
How to treat ALL C# 8 nullable reference warnings as errors? Using Visual Studio 2019 v16.3.2 with a .NET Core 3.0 project set to C# 8 and nullable reference types enabled. If I set it to treat all wa...
- Modified
- 20 Jun at 09:12
Nullable reference types with generic return type
Nullable reference types with generic return type I'm playing around a bit with the new C# 8 nullable reference types feature, and while refactoring my code I came upon this (simplified) method: Now, ...
- Modified
- 2 Sep at 19:33
How to suppress Possible Null Reference warnings
How to suppress Possible Null Reference warnings I am playing with the nullable types in c# 8 and I found a problem that is bugging me. Suppose I have a method which takes a nullable parameter. When a...
- Modified
- 23 Apr at 09:59
Nullable reference type information not exposed from FirstOrDefault
Nullable reference type information not exposed from FirstOrDefault I wanted to test out the new [nullable reference types](https://learn.microsoft.com/en-us/dotnet/csharp/nullable-references) feature...
- Modified
- 10 Apr at 21:26
Nullable Reference Types and the Options Pattern
Nullable Reference Types and the Options Pattern How can we use in combination with the [Options pattern](https://learn.microsoft.com/en-us/aspnet/core/fundamentals/configuration/options?view=aspnetco...
- Modified
- 24 Sep at 19:28
Nullable reference types and constructor warnings
Nullable reference types and constructor warnings I'm trying to embrace C# 8's nullable references types in my project and make it smoothly work with EF Core. Following [this guide](https://learn.micr...
- Modified
- 15 Apr at 15:5
Non-nullable string type, how to use with Asp.Net Core options
Non-nullable string type, how to use with Asp.Net Core options MS states [Express your design intent more clearly with nullable and non-nullable reference types](https://learn.microsoft.com/en-us/dotn...
- Modified
- 23 May at 03:31
Init-only reference properties with nullable enabled in C# 10.0
Init-only reference properties with nullable enabled in C# 10.0 I tried to use init-only properties to force client code to initialize my class when they create it, but without a constructor. It's not...
- Modified
- 20 Dec at 22:38
How can I hint the C# 8.0 nullable reference system that a property is initalized using reflection
How can I hint the C# 8.0 nullable reference system that a property is initalized using reflection I ran into an interesting problem when I tried to use Entity Framework Core with the new nullable ref...
- Modified
- 4 Aug at 00:25
Nullable reference types: How to specify "T?" type without constraining to class or struct
Nullable reference types: How to specify "T?" type without constraining to class or struct I want to create a generic class that has a member of type `T`. `T` may be a class, a nullable class, a struc...
- Modified
- 14 Jul at 03:5
How to use C# 8.0 Nullable Reference Types with Entity Framework Core models?
How to use C# 8.0 Nullable Reference Types with Entity Framework Core models? I am enabling C# 8.0 Nullable Reference Types on a .NET Core 3.0 project. The project uses Entity Framework Core 3.0 to ac...
- Modified
- 30 Sep at 17:12
Avoid CS8618 warning when initializing mutable non nullable property with argument validation
Avoid CS8618 warning when initializing mutable non nullable property with argument validation I have a question regarding [nullable reference type system](https://learn.microsoft.com/en-us/dotnet/csha...
- Modified
- 27 Sep at 00:35
Why do we get possible dereference null reference warning, when null reference does not seem to be possible?
Why do we get possible dereference null reference warning, when null reference does not seem to be possible? Having read [this question](https://stackoverflow.com/q/59518973/284111) on HNQ, I went on ...
- Modified
- 10 Apr at 21:36
C# 8.0 non-nullable reference types and options pattern
C# 8.0 non-nullable reference types and options pattern Tl;dr: C# 8.0 introduces [Nullable Reference Types.](https://learn.microsoft.com/en-us/dotnet/csharp/nullable-references) I've found that using ...
- Modified
- 25 Apr at 04:29
Non-nullable reference types' default values VS non-nullable value types' default values
Non-nullable reference types' default values VS non-nullable value types' default values This isn't my first question about nullable reference types as it's been few months I'm experiencing with it. B...
- Modified
- 26 Aug at 13:38