diff options
author | DamianEdwards <damian@damianedwards.com> | 2021-07-01 03:29:17 +0300 |
---|---|---|
committer | DamianEdwards <damian@damianedwards.com> | 2021-07-01 23:01:39 +0300 |
commit | 802ded27e9a4481967622660c518f6a5e73c4871 (patch) | |
tree | c303c89af3f09f4f1e4f2b031e04b8b2e57382fe | |
parent | 2f2d687f6a8d217734179d9ee3dc5413f297bd4d (diff) |
Enable nullable references in project templates
Contributes to dotnet/aspnetcore#33947
Commit migrated from dotnet/aspnetcore@7db552674af2
-rw-r--r-- | src/Angular-CSharp.csproj.in | 1 | ||||
-rw-r--r-- | src/React-CSharp.csproj.in | 1 | ||||
-rw-r--r-- | src/content/Angular-CSharp/.template.config/template.json | 3 | ||||
-rw-r--r-- | src/content/Angular-CSharp/Pages/Error.cshtml.cs | 2 | ||||
-rw-r--r-- | src/content/Angular-CSharp/WeatherForecast.cs | 2 | ||||
-rw-r--r-- | src/content/React-CSharp/.template.config/template.json | 3 | ||||
-rw-r--r-- | src/content/React-CSharp/Pages/Error.cshtml.cs | 2 | ||||
-rw-r--r-- | src/content/React-CSharp/Pages/Shared/_LoginPartial.cshtml | 2 | ||||
-rw-r--r-- | src/content/React-CSharp/WeatherForecast.cs | 2 |
9 files changed, 11 insertions, 7 deletions
diff --git a/src/Angular-CSharp.csproj.in b/src/Angular-CSharp.csproj.in index bd68bc2..c705164 100644 --- a/src/Angular-CSharp.csproj.in +++ b/src/Angular-CSharp.csproj.in @@ -2,6 +2,7 @@ <PropertyGroup> <TargetFramework>${DefaultNetCoreTargetFramework}</TargetFramework> + <Nullable>enable</Nullable> <IsPackable>false</IsPackable> <SpaRoot>ClientApp\</SpaRoot> <SpaProxyServerUrl Condition="'$(RequiresHttps)' == 'True'">https://localhost:5002</SpaProxyServerUrl> diff --git a/src/React-CSharp.csproj.in b/src/React-CSharp.csproj.in index 43706ed..5eb953d 100644 --- a/src/React-CSharp.csproj.in +++ b/src/React-CSharp.csproj.in @@ -2,6 +2,7 @@ <PropertyGroup> <TargetFramework>${DefaultNetCoreTargetFramework}</TargetFramework> + <Nullable>enable</Nullable> <TypeScriptCompileBlocked>true</TypeScriptCompileBlocked> <TypeScriptToolsVersion>Latest</TypeScriptToolsVersion> <IsPackable>false</IsPackable> diff --git a/src/content/Angular-CSharp/.template.config/template.json b/src/content/Angular-CSharp/.template.config/template.json index 1302b3f..7249d2e 100644 --- a/src/content/Angular-CSharp/.template.config/template.json +++ b/src/content/Angular-CSharp/.template.config/template.json @@ -25,7 +25,8 @@ ".template.config/**" ], "copyOnly": [ - "wwwroot/**" + "wwwroot/**", + "ClientApp/package-lock.json" ], "modifiers": [ { diff --git a/src/content/Angular-CSharp/Pages/Error.cshtml.cs b/src/content/Angular-CSharp/Pages/Error.cshtml.cs index b31bc6a..4c1de86 100644 --- a/src/content/Angular-CSharp/Pages/Error.cshtml.cs +++ b/src/content/Angular-CSharp/Pages/Error.cshtml.cs @@ -19,7 +19,7 @@ namespace Company.WebApplication1.Pages _logger = logger; } - public string RequestId { get; set; } + public string? RequestId { get; set; } public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); diff --git a/src/content/Angular-CSharp/WeatherForecast.cs b/src/content/Angular-CSharp/WeatherForecast.cs index 128b347..7ff35e1 100644 --- a/src/content/Angular-CSharp/WeatherForecast.cs +++ b/src/content/Angular-CSharp/WeatherForecast.cs @@ -10,6 +10,6 @@ namespace Company.WebApplication1 public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); - public string Summary { get; set; } + public string? Summary { get; set; } } } diff --git a/src/content/React-CSharp/.template.config/template.json b/src/content/React-CSharp/.template.config/template.json index 0d47ffb..47ea11d 100644 --- a/src/content/React-CSharp/.template.config/template.json +++ b/src/content/React-CSharp/.template.config/template.json @@ -25,7 +25,8 @@ ".template.config/**" ], "copyOnly": [ - "wwwroot/**" + "wwwroot/**", + "ClientApp/package-lock.json" ], "modifiers": [ { diff --git a/src/content/React-CSharp/Pages/Error.cshtml.cs b/src/content/React-CSharp/Pages/Error.cshtml.cs index b31bc6a..4c1de86 100644 --- a/src/content/React-CSharp/Pages/Error.cshtml.cs +++ b/src/content/React-CSharp/Pages/Error.cshtml.cs @@ -19,7 +19,7 @@ namespace Company.WebApplication1.Pages _logger = logger; } - public string RequestId { get; set; } + public string? RequestId { get; set; } public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); diff --git a/src/content/React-CSharp/Pages/Shared/_LoginPartial.cshtml b/src/content/React-CSharp/Pages/Shared/_LoginPartial.cshtml index f2884db..8e7fccb 100644 --- a/src/content/React-CSharp/Pages/Shared/_LoginPartial.cshtml +++ b/src/content/React-CSharp/Pages/Shared/_LoginPartial.cshtml @@ -16,7 +16,7 @@ @if (SignInManager.IsSignedIn(User)) { <li class="nav-item"> - <a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Manage/Index" title="Manage">Hello @User.Identity.Name!</a> + <a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Manage/Index" title="Manage">Hello @User.Identity?.Name!</a> </li> <li class="nav-item"> <form class="form-inline" asp-area="Identity" asp-page="/Account/Logout" asp-route-returnUrl="/"> diff --git a/src/content/React-CSharp/WeatherForecast.cs b/src/content/React-CSharp/WeatherForecast.cs index 128b347..7ff35e1 100644 --- a/src/content/React-CSharp/WeatherForecast.cs +++ b/src/content/React-CSharp/WeatherForecast.cs @@ -10,6 +10,6 @@ namespace Company.WebApplication1 public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); - public string Summary { get; set; } + public string? Summary { get; set; } } } |