Update scaffolders to support nullable reference types
See original GitHub issueNullable reference types was a feature introduced in C# 8. In .NET 6 we intend to enable it for new projects by default (see dotnet/templating#3359).
Any code emitted into a project by scaffolders should ensure that it doesn’t introduce nullability warnings given the configuration of nullable reference types in the target project. This might mean updating the code to be “safe” for inclusion when nullable is on or off, or making the scaffolder emit different code depending on whether the project’s nullable context configuration (i.e. the value of the <Nullable>
property in the .csproj file).
Issue Analytics
- State:
- Created 2 years ago
- Reactions:8
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Entity Framework core6 Scaffold-DbContext for .NET 6 ...
I ran the Scaffold-DbContext command in the Package Manager Console ... "Warning CS8632 The annotation for nullable reference types should ...
Read more >Update your codebase to use nullable reference types
Nullable reference types enable you to declare if variables of a reference type should or shouldn't be assigned a null value.
Read more >Scaffolding (Reverse Engineering) - EF Core
The scaffolder can create EF model and entity types that use C# nullable reference types (NRTs). NRT usage is scaffolded automatically when NRT ......
Read more >Preparing Entity Framework Core for Static Analysis and ...
In this article we walk through the process of updating an EF Core 3.1 based data ... FxCopAnalyzers) and C# 8's nullable reference...
Read more >Techniques and tools to update your C# project - Migrating to ...
It may be of help when migrating to C# nullable reference types, as it will definitely uncover some cases where you need additional...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey @Rick-Anderson, all templates should be nullable friendly in .NET 7. There was a regression recently but should be resolved for GA.
For .NET 7, I just needed to make the following change in 3 files
Can I get a guarantee this is fixed right for .NET 8? cc @vijayrkn @deepchoudhery