File tree Expand file tree Collapse file tree 5 files changed +10
-13
lines changed
ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/Views/Shared Expand file tree Collapse file tree 5 files changed +10
-13
lines changed Original file line number Diff line number Diff line change 1
1
#nullable enable
2
+ *REMOVED*Microsoft.AspNetCore.Mvc.Razor.RazorPage<TModel>.Model.get -> TModel?
3
+ Microsoft.AspNetCore.Mvc.Razor.RazorPage<TModel>.Model.get -> TModel
Original file line number Diff line number Diff line change @@ -15,13 +15,12 @@ public abstract class RazorPage<TModel> : RazorPage
15
15
/// <summary>
16
16
/// Gets the Model property of the <see cref="ViewData"/> property.
17
17
/// </summary>
18
- public TModel ? Model => ViewData == null ? default ( TModel ) : ViewData . Model ;
18
+ public TModel Model => ViewData . Model ;
19
19
20
20
/// <summary>
21
21
/// Gets or sets the dictionary for view data.
22
22
/// </summary>
23
23
[ RazorInject ]
24
24
public ViewDataDictionary < TModel > ViewData { get ; set ; } = default ! ;
25
-
26
25
}
27
26
}
Original file line number Diff line number Diff line change 1
1
#nullable enable
2
+ *REMOVED*Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary<TModel>.Model.get -> TModel?
3
+ Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary<TModel>.Model.get -> TModel
Original file line number Diff line number Diff line change @@ -86,16 +86,10 @@ internal ViewDataDictionary(IModelMetadataProvider metadataProvider)
86
86
}
87
87
88
88
/// <inheritdoc />
89
- public new TModel ? Model
89
+ public new TModel Model
90
90
{
91
- get
92
- {
93
- return ( base . Model == null ) ? default ( TModel ) : ( TModel ) base . Model ;
94
- }
95
- set
96
- {
97
- base . Model = value ;
98
- }
91
+ get => ( base . Model is null ) ? default ! : ( TModel ) base . Model ;
92
+ set => base . Model = value ;
99
93
}
100
94
}
101
95
}
Original file line number Diff line number Diff line change 6
6
<h1 class =" text-danger" >Error.</h1 >
7
7
<h2 class =" text-danger" >An error occurred while processing your request.</h2 >
8
8
9
- @if (Model ? .ShowRequestId ?? false )
9
+ @if (Model .ShowRequestId )
10
10
{
11
11
<p >
12
- <strong >Request ID : </strong > <code >@Model ? .RequestId </code >
12
+ <strong >Request ID : </strong > <code >@Model.RequestId </code >
13
13
</p >
14
14
}
15
15
You can’t perform that action at this time.
0 commit comments