Make AddComponentReferenceCapture delegate non-null (#24842)
* Make the sample nullable enabled Fixes https://github.com/dotnet/aspnetcore/issues/24794
This commit is contained in:
parent
3f6ea38f44
commit
3e61104425
|
|
@ -104,7 +104,7 @@ namespace Microsoft.AspNetCore.Components.RenderTree
|
|||
};
|
||||
}
|
||||
|
||||
public void AppendComponentReferenceCapture(int sequence, Action<object?> componentReferenceCaptureAction, int parentFrameIndexValue)
|
||||
public void AppendComponentReferenceCapture(int sequence, Action<object> componentReferenceCaptureAction, int parentFrameIndexValue)
|
||||
{
|
||||
if (_itemsInUse == _items.Length)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -586,7 +586,7 @@ namespace Microsoft.AspNetCore.Components.Rendering
|
|||
/// </summary>
|
||||
/// <param name="sequence">An integer that represents the position of the instruction in the source code.</param>
|
||||
/// <param name="componentReferenceCaptureAction">An action to be invoked whenever the reference value changes.</param>
|
||||
public void AddComponentReferenceCapture(int sequence, Action<object?> componentReferenceCaptureAction)
|
||||
public void AddComponentReferenceCapture(int sequence, Action<object> componentReferenceCaptureAction)
|
||||
{
|
||||
var parentFrameIndex = GetCurrentParentFrameIndex();
|
||||
if (!parentFrameIndex.HasValue)
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
<PropertyGroup>
|
||||
<TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework>
|
||||
<IsShippingPackage>false</IsShippingPackage>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -10,6 +10,6 @@ namespace BlazorServerApp.Data
|
|||
|
||||
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
|
||||
|
||||
public string Summary { get; set; }
|
||||
public string Summary { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ else
|
|||
}
|
||||
|
||||
@code {
|
||||
WeatherForecast[] forecasts;
|
||||
WeatherForecast[]? forecasts;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
@code {
|
||||
bool collapseNavMenu = true;
|
||||
|
||||
string NavMenuCssClass => collapseNavMenu ? "collapse" : null;
|
||||
string? NavMenuCssClass => collapseNavMenu ? "collapse" : null;
|
||||
|
||||
void ToggleNavMenu()
|
||||
{
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue