C#8 Nullable ref types - returnUrl field is required
- Dominant language
- C#
- Stars
- 818
- Forks
- 260
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 10
Description
Moved from https://github.com/dotnet/AspNetCore.Docs/issues/17145 by @djhmateer
When scaffolding out the Identity code and I have C#8 nullable ref types checking set in the .csproj
```
enable
```
I need to change the methods which have a default value set to null eg
```
public async Task OnGetAsync(string returnUrl = null)
```
to be a nullable string ie `string?` otherwise, the UI will set ModelState error giving returnUrl field is required
---
#### Document details
⚠ *Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.*
* ID: 804e24dd-7e30-8cf5-2c99-1ffacb4582f6
* Version Independent ID: 3e25547b-e2c9-6634-2c38-2a77207f17d4
* Content: [Scaffold Identity in ASP.NET Core projects](https://docs.microsoft.com/en-gb/aspnet/core/security/authentication/scaffold-identity?view=aspnetcore-3.1&tabs=netcore-cli#scaffold-identity-into-a-razor-project-with-authorization)
* Content Source: [aspnetcore/security/authentication/scaffold-identity.md](https://github.com/dotnet/AspNetCore.Docs/blob/master/aspnetcore/security/authentication/scaffold-identity.md)
* Product: **aspnet-core**
* Technology: **aspnetcore-security**
* GitHub Login: @Rick-Anderson
* Microsoft Alias: **riande**
Contributor guide
Assessment
This issue has not been assessed yet.