Add nullable annotations to Microsoft.AspNetCore.Mvc.Abstractions (#22993)
* Add nullable annotations to Microsoft.AspNetCore.Mvc.Abstractions Contributes to https://github.com/dotnet/aspnetcore/issues/5680 * Changes per PR comments * Changes per PR comments * Fixup
This commit is contained in:
parent
c566677456
commit
f5709b4080
|
|
@ -2,6 +2,7 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>$(DefaultNetCoreTargetFramework)</TargetFrameworks>
|
||||
<Nullable>annotations</Nullable>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Condition="'$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)'">
|
||||
<Compile Include="Microsoft.AspNetCore.Mvc.Abstractions.netcoreapp.cs" />
|
||||
|
|
|
|||
|
|
@ -33,10 +33,10 @@ namespace Microsoft.AspNetCore.Mvc.Abstractions
|
|||
public partial class ActionDescriptor
|
||||
{
|
||||
public ActionDescriptor() { }
|
||||
public System.Collections.Generic.IList<Microsoft.AspNetCore.Mvc.ActionConstraints.IActionConstraintMetadata> ActionConstraints { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public Microsoft.AspNetCore.Mvc.Routing.AttributeRouteInfo AttributeRouteInfo { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public System.Collections.Generic.IList<Microsoft.AspNetCore.Mvc.ActionConstraints.IActionConstraintMetadata>? ActionConstraints { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public Microsoft.AspNetCore.Mvc.Routing.AttributeRouteInfo? AttributeRouteInfo { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public System.Collections.Generic.IList<Microsoft.AspNetCore.Mvc.Abstractions.ParameterDescriptor> BoundProperties { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public virtual string DisplayName { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public virtual string? DisplayName { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public System.Collections.Generic.IList<object> EndpointMetadata { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public System.Collections.Generic.IList<Microsoft.AspNetCore.Mvc.Filters.FilterDescriptor> FilterDescriptors { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public string Id { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } }
|
||||
|
|
@ -58,7 +58,7 @@ namespace Microsoft.AspNetCore.Mvc.Abstractions
|
|||
{
|
||||
public ActionInvokerProviderContext(Microsoft.AspNetCore.Mvc.ActionContext actionContext) { }
|
||||
public Microsoft.AspNetCore.Mvc.ActionContext ActionContext { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } }
|
||||
public Microsoft.AspNetCore.Mvc.Abstractions.IActionInvoker Result { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public Microsoft.AspNetCore.Mvc.Abstractions.IActionInvoker? Result { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
}
|
||||
public partial interface IActionDescriptorProvider
|
||||
{
|
||||
|
|
@ -143,8 +143,8 @@ namespace Microsoft.AspNetCore.Mvc.ApiExplorer
|
|||
{
|
||||
public ApiDescription() { }
|
||||
public Microsoft.AspNetCore.Mvc.Abstractions.ActionDescriptor ActionDescriptor { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public string GroupName { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public string HttpMethod { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public string? GroupName { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public string? HttpMethod { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public System.Collections.Generic.IList<Microsoft.AspNetCore.Mvc.ApiExplorer.ApiParameterDescription> ParameterDescriptions { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } }
|
||||
public System.Collections.Generic.IDictionary<object, object> Properties { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } }
|
||||
public string RelativePath { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
|
|
@ -160,21 +160,21 @@ namespace Microsoft.AspNetCore.Mvc.ApiExplorer
|
|||
public partial class ApiParameterDescription
|
||||
{
|
||||
public ApiParameterDescription() { }
|
||||
public Microsoft.AspNetCore.Mvc.ModelBinding.BindingInfo BindingInfo { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public object DefaultValue { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public Microsoft.AspNetCore.Mvc.ModelBinding.BindingInfo? BindingInfo { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public object? DefaultValue { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public bool IsRequired { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata ModelMetadata { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public string Name { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public Microsoft.AspNetCore.Mvc.Abstractions.ParameterDescriptor ParameterDescriptor { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public Microsoft.AspNetCore.Mvc.ApiExplorer.ApiParameterRouteInfo RouteInfo { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public Microsoft.AspNetCore.Mvc.ApiExplorer.ApiParameterRouteInfo? RouteInfo { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public Microsoft.AspNetCore.Mvc.ModelBinding.BindingSource Source { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public System.Type Type { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
}
|
||||
public partial class ApiParameterRouteInfo
|
||||
{
|
||||
public ApiParameterRouteInfo() { }
|
||||
public System.Collections.Generic.IEnumerable<Microsoft.AspNetCore.Routing.IRouteConstraint> Constraints { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public object DefaultValue { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public System.Collections.Generic.IEnumerable<Microsoft.AspNetCore.Routing.IRouteConstraint>? Constraints { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public object? DefaultValue { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public bool IsOptional { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
}
|
||||
public partial class ApiRequestFormat
|
||||
|
|
@ -194,9 +194,9 @@ namespace Microsoft.AspNetCore.Mvc.ApiExplorer
|
|||
public ApiResponseType() { }
|
||||
public System.Collections.Generic.IList<Microsoft.AspNetCore.Mvc.ApiExplorer.ApiResponseFormat> ApiResponseFormats { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public bool IsDefaultResponse { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata ModelMetadata { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata? ModelMetadata { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public int StatusCode { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public System.Type Type { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public System.Type? Type { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
}
|
||||
public partial interface IApiDescriptionProvider
|
||||
{
|
||||
|
|
@ -218,8 +218,8 @@ namespace Microsoft.AspNetCore.Mvc.Filters
|
|||
public ActionExecutedContext(Microsoft.AspNetCore.Mvc.ActionContext actionContext, System.Collections.Generic.IList<Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata> filters, object controller) : base (default(Microsoft.AspNetCore.Mvc.ActionContext), default(System.Collections.Generic.IList<Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata>)) { }
|
||||
public virtual bool Canceled { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public virtual object Controller { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } }
|
||||
public virtual System.Exception Exception { get { throw null; } set { } }
|
||||
public virtual System.Runtime.ExceptionServices.ExceptionDispatchInfo ExceptionDispatchInfo { get { throw null; } set { } }
|
||||
public virtual System.Exception? Exception { get { throw null; } set { } }
|
||||
public virtual System.Runtime.ExceptionServices.ExceptionDispatchInfo? ExceptionDispatchInfo { get { throw null; } set { } }
|
||||
public virtual bool ExceptionHandled { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public virtual Microsoft.AspNetCore.Mvc.IActionResult Result { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
}
|
||||
|
|
@ -228,26 +228,27 @@ namespace Microsoft.AspNetCore.Mvc.Filters
|
|||
public ActionExecutingContext(Microsoft.AspNetCore.Mvc.ActionContext actionContext, System.Collections.Generic.IList<Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata> filters, System.Collections.Generic.IDictionary<string, object> actionArguments, object controller) : base (default(Microsoft.AspNetCore.Mvc.ActionContext), default(System.Collections.Generic.IList<Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata>)) { }
|
||||
public virtual System.Collections.Generic.IDictionary<string, object> ActionArguments { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } }
|
||||
public virtual object Controller { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } }
|
||||
public virtual Microsoft.AspNetCore.Mvc.IActionResult Result { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public virtual Microsoft.AspNetCore.Mvc.IActionResult? Result { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
}
|
||||
public delegate System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.Filters.ActionExecutedContext> ActionExecutionDelegate();
|
||||
public partial class AuthorizationFilterContext : Microsoft.AspNetCore.Mvc.Filters.FilterContext
|
||||
{
|
||||
public AuthorizationFilterContext(Microsoft.AspNetCore.Mvc.ActionContext actionContext, System.Collections.Generic.IList<Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata> filters) : base (default(Microsoft.AspNetCore.Mvc.ActionContext), default(System.Collections.Generic.IList<Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata>)) { }
|
||||
public virtual Microsoft.AspNetCore.Mvc.IActionResult Result { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public virtual Microsoft.AspNetCore.Mvc.IActionResult? Result { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
}
|
||||
public partial class ExceptionContext : Microsoft.AspNetCore.Mvc.Filters.FilterContext
|
||||
{
|
||||
public ExceptionContext(Microsoft.AspNetCore.Mvc.ActionContext actionContext, System.Collections.Generic.IList<Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata> filters) : base (default(Microsoft.AspNetCore.Mvc.ActionContext), default(System.Collections.Generic.IList<Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata>)) { }
|
||||
public virtual System.Exception Exception { get { throw null; } set { } }
|
||||
public virtual System.Runtime.ExceptionServices.ExceptionDispatchInfo ExceptionDispatchInfo { get { throw null; } set { } }
|
||||
public virtual System.Runtime.ExceptionServices.ExceptionDispatchInfo? ExceptionDispatchInfo { get { throw null; } set { } }
|
||||
public virtual bool ExceptionHandled { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public virtual Microsoft.AspNetCore.Mvc.IActionResult Result { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public virtual Microsoft.AspNetCore.Mvc.IActionResult? Result { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
}
|
||||
public abstract partial class FilterContext : Microsoft.AspNetCore.Mvc.ActionContext
|
||||
{
|
||||
public FilterContext(Microsoft.AspNetCore.Mvc.ActionContext actionContext, System.Collections.Generic.IList<Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata> filters) { }
|
||||
public virtual System.Collections.Generic.IList<Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata> Filters { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } }
|
||||
[return: System.Diagnostics.CodeAnalysis.MaybeNullAttribute]
|
||||
public TMetadata FindEffectivePolicy<TMetadata>() where TMetadata : Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata { throw null; }
|
||||
public bool IsEffectivePolicy<TMetadata>(TMetadata policy) where TMetadata : Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata { throw null; }
|
||||
}
|
||||
|
|
@ -349,15 +350,15 @@ namespace Microsoft.AspNetCore.Mvc.Filters
|
|||
{
|
||||
public ResourceExecutedContext(Microsoft.AspNetCore.Mvc.ActionContext actionContext, System.Collections.Generic.IList<Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata> filters) : base (default(Microsoft.AspNetCore.Mvc.ActionContext), default(System.Collections.Generic.IList<Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata>)) { }
|
||||
public virtual bool Canceled { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public virtual System.Exception Exception { get { throw null; } set { } }
|
||||
public virtual System.Runtime.ExceptionServices.ExceptionDispatchInfo ExceptionDispatchInfo { get { throw null; } set { } }
|
||||
public virtual System.Exception? Exception { get { throw null; } set { } }
|
||||
public virtual System.Runtime.ExceptionServices.ExceptionDispatchInfo? ExceptionDispatchInfo { get { throw null; } set { } }
|
||||
public virtual bool ExceptionHandled { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public virtual Microsoft.AspNetCore.Mvc.IActionResult Result { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public virtual Microsoft.AspNetCore.Mvc.IActionResult? Result { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
}
|
||||
public partial class ResourceExecutingContext : Microsoft.AspNetCore.Mvc.Filters.FilterContext
|
||||
{
|
||||
public ResourceExecutingContext(Microsoft.AspNetCore.Mvc.ActionContext actionContext, System.Collections.Generic.IList<Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata> filters, System.Collections.Generic.IList<Microsoft.AspNetCore.Mvc.ModelBinding.IValueProviderFactory> valueProviderFactories) : base (default(Microsoft.AspNetCore.Mvc.ActionContext), default(System.Collections.Generic.IList<Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata>)) { }
|
||||
public virtual Microsoft.AspNetCore.Mvc.IActionResult Result { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public virtual Microsoft.AspNetCore.Mvc.IActionResult? Result { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public System.Collections.Generic.IList<Microsoft.AspNetCore.Mvc.ModelBinding.IValueProviderFactory> ValueProviderFactories { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } }
|
||||
}
|
||||
public delegate System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.Filters.ResourceExecutedContext> ResourceExecutionDelegate();
|
||||
|
|
@ -366,8 +367,8 @@ namespace Microsoft.AspNetCore.Mvc.Filters
|
|||
public ResultExecutedContext(Microsoft.AspNetCore.Mvc.ActionContext actionContext, System.Collections.Generic.IList<Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata> filters, Microsoft.AspNetCore.Mvc.IActionResult result, object controller) : base (default(Microsoft.AspNetCore.Mvc.ActionContext), default(System.Collections.Generic.IList<Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata>)) { }
|
||||
public virtual bool Canceled { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public virtual object Controller { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } }
|
||||
public virtual System.Exception Exception { get { throw null; } set { } }
|
||||
public virtual System.Runtime.ExceptionServices.ExceptionDispatchInfo ExceptionDispatchInfo { get { throw null; } set { } }
|
||||
public virtual System.Exception? Exception { get { throw null; } set { } }
|
||||
public virtual System.Runtime.ExceptionServices.ExceptionDispatchInfo? ExceptionDispatchInfo { get { throw null; } set { } }
|
||||
public virtual bool ExceptionHandled { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public virtual Microsoft.AspNetCore.Mvc.IActionResult Result { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } }
|
||||
}
|
||||
|
|
@ -382,7 +383,7 @@ namespace Microsoft.AspNetCore.Mvc.Filters
|
|||
}
|
||||
namespace Microsoft.AspNetCore.Mvc.Formatters
|
||||
{
|
||||
public partial class FormatterCollection<TFormatter> : System.Collections.ObjectModel.Collection<TFormatter>
|
||||
public partial class FormatterCollection<TFormatter> : System.Collections.ObjectModel.Collection<TFormatter> where TFormatter : notnull
|
||||
{
|
||||
public FormatterCollection() { }
|
||||
public FormatterCollection(System.Collections.Generic.IList<TFormatter> list) { }
|
||||
|
|
@ -426,7 +427,7 @@ namespace Microsoft.AspNetCore.Mvc.Formatters
|
|||
internal InputFormatterResult() { }
|
||||
public bool HasError { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } }
|
||||
public bool IsModelSet { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } }
|
||||
public object Model { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } }
|
||||
public object? Model { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } }
|
||||
public static Microsoft.AspNetCore.Mvc.Formatters.InputFormatterResult Failure() { throw null; }
|
||||
public static System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.Formatters.InputFormatterResult> FailureAsync() { throw null; }
|
||||
public static Microsoft.AspNetCore.Mvc.Formatters.InputFormatterResult NoValue() { throw null; }
|
||||
|
|
@ -445,8 +446,8 @@ namespace Microsoft.AspNetCore.Mvc.Formatters
|
|||
public virtual Microsoft.Extensions.Primitives.StringSegment ContentType { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public virtual bool ContentTypeIsServerDefined { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public virtual Microsoft.AspNetCore.Http.HttpContext HttpContext { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] protected set { } }
|
||||
public virtual object Object { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] protected set { } }
|
||||
public virtual System.Type ObjectType { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] protected set { } }
|
||||
public virtual object? Object { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] protected set { } }
|
||||
public virtual System.Type? ObjectType { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] protected set { } }
|
||||
}
|
||||
public partial class OutputFormatterWriteContext : Microsoft.AspNetCore.Mvc.Formatters.OutputFormatterCanWriteContext
|
||||
{
|
||||
|
|
@ -460,18 +461,18 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
{
|
||||
public BindingInfo() { }
|
||||
public BindingInfo(Microsoft.AspNetCore.Mvc.ModelBinding.BindingInfo other) { }
|
||||
public string BinderModelName { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public System.Type BinderType { get { throw null; } set { } }
|
||||
public Microsoft.AspNetCore.Mvc.ModelBinding.BindingSource BindingSource { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public string? BinderModelName { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public System.Type? BinderType { get { throw null; } set { } }
|
||||
public Microsoft.AspNetCore.Mvc.ModelBinding.BindingSource? BindingSource { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public Microsoft.AspNetCore.Mvc.ModelBinding.EmptyBodyBehavior EmptyBodyBehavior { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public Microsoft.AspNetCore.Mvc.ModelBinding.IPropertyFilterProvider PropertyFilterProvider { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public System.Func<Microsoft.AspNetCore.Mvc.ActionContext, bool> RequestPredicate { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public static Microsoft.AspNetCore.Mvc.ModelBinding.BindingInfo GetBindingInfo(System.Collections.Generic.IEnumerable<object> attributes) { throw null; }
|
||||
public static Microsoft.AspNetCore.Mvc.ModelBinding.BindingInfo GetBindingInfo(System.Collections.Generic.IEnumerable<object> attributes, Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata modelMetadata) { throw null; }
|
||||
public Microsoft.AspNetCore.Mvc.ModelBinding.IPropertyFilterProvider? PropertyFilterProvider { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public System.Func<Microsoft.AspNetCore.Mvc.ActionContext, bool>? RequestPredicate { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public static Microsoft.AspNetCore.Mvc.ModelBinding.BindingInfo? GetBindingInfo(System.Collections.Generic.IEnumerable<object> attributes) { throw null; }
|
||||
public static Microsoft.AspNetCore.Mvc.ModelBinding.BindingInfo? GetBindingInfo(System.Collections.Generic.IEnumerable<object> attributes, Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata modelMetadata) { throw null; }
|
||||
public bool TryApplyBindingInfo(Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata modelMetadata) { throw null; }
|
||||
}
|
||||
[System.Diagnostics.DebuggerDisplayAttribute("Source: {DisplayName}")]
|
||||
public partial class BindingSource : System.IEquatable<Microsoft.AspNetCore.Mvc.ModelBinding.BindingSource>
|
||||
public partial class BindingSource : System.IEquatable<Microsoft.AspNetCore.Mvc.ModelBinding.BindingSource?>
|
||||
{
|
||||
public static readonly Microsoft.AspNetCore.Mvc.ModelBinding.BindingSource Body;
|
||||
public static readonly Microsoft.AspNetCore.Mvc.ModelBinding.BindingSource Custom;
|
||||
|
|
@ -489,11 +490,11 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
public bool IsFromRequest { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } }
|
||||
public bool IsGreedy { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } }
|
||||
public virtual bool CanAcceptDataFrom(Microsoft.AspNetCore.Mvc.ModelBinding.BindingSource bindingSource) { throw null; }
|
||||
public bool Equals(Microsoft.AspNetCore.Mvc.ModelBinding.BindingSource other) { throw null; }
|
||||
public override bool Equals(object obj) { throw null; }
|
||||
public bool Equals(Microsoft.AspNetCore.Mvc.ModelBinding.BindingSource? other) { throw null; }
|
||||
public override bool Equals(object? obj) { throw null; }
|
||||
public override int GetHashCode() { throw null; }
|
||||
public static bool operator ==(Microsoft.AspNetCore.Mvc.ModelBinding.BindingSource s1, Microsoft.AspNetCore.Mvc.ModelBinding.BindingSource s2) { throw null; }
|
||||
public static bool operator !=(Microsoft.AspNetCore.Mvc.ModelBinding.BindingSource s1, Microsoft.AspNetCore.Mvc.ModelBinding.BindingSource s2) { throw null; }
|
||||
public static bool operator ==(Microsoft.AspNetCore.Mvc.ModelBinding.BindingSource? s1, Microsoft.AspNetCore.Mvc.ModelBinding.BindingSource? s2) { throw null; }
|
||||
public static bool operator !=(Microsoft.AspNetCore.Mvc.ModelBinding.BindingSource? s1, Microsoft.AspNetCore.Mvc.ModelBinding.BindingSource? s2) { throw null; }
|
||||
}
|
||||
public partial class CompositeBindingSource : Microsoft.AspNetCore.Mvc.ModelBinding.BindingSource
|
||||
{
|
||||
|
|
@ -524,7 +525,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
}
|
||||
public partial interface IBindingSourceMetadata
|
||||
{
|
||||
Microsoft.AspNetCore.Mvc.ModelBinding.BindingSource BindingSource { get; }
|
||||
Microsoft.AspNetCore.Mvc.ModelBinding.BindingSource? BindingSource { get; }
|
||||
}
|
||||
public partial interface IModelBinder
|
||||
{
|
||||
|
|
@ -607,9 +608,9 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
private readonly object _dummy;
|
||||
private readonly int _dummyPrimitive;
|
||||
public bool IsModelSet { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } }
|
||||
public object Model { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } }
|
||||
public object? Model { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } }
|
||||
public bool Equals(Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingResult other) { throw null; }
|
||||
public override bool Equals(object obj) { throw null; }
|
||||
public override bool Equals(object? obj) { throw null; }
|
||||
public static Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingResult Failed() { throw null; }
|
||||
public override int GetHashCode() { throw null; }
|
||||
public static bool operator ==(Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingResult x, Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingResult y) { throw null; }
|
||||
|
|
@ -620,10 +621,10 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
public partial class ModelError
|
||||
{
|
||||
public ModelError(System.Exception exception) { }
|
||||
public ModelError(System.Exception exception, string errorMessage) { }
|
||||
public ModelError(string errorMessage) { }
|
||||
public ModelError(System.Exception exception, string? errorMessage) { }
|
||||
public ModelError(string? errorMessage) { }
|
||||
public string ErrorMessage { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } }
|
||||
public System.Exception Exception { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } }
|
||||
public System.Exception? Exception { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } }
|
||||
}
|
||||
public partial class ModelErrorCollection : System.Collections.ObjectModel.Collection<Microsoft.AspNetCore.Mvc.ModelBinding.ModelError>
|
||||
{
|
||||
|
|
@ -632,7 +633,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
public void Add(string errorMessage) { }
|
||||
}
|
||||
[System.Diagnostics.DebuggerDisplayAttribute("{DebuggerToString(),nq}")]
|
||||
public abstract partial class ModelMetadata : Microsoft.AspNetCore.Mvc.ModelBinding.IModelMetadataProvider, System.IEquatable<Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata>
|
||||
public abstract partial class ModelMetadata : Microsoft.AspNetCore.Mvc.ModelBinding.IModelMetadataProvider, System.IEquatable<Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata?>
|
||||
{
|
||||
public static readonly int DefaultOrder;
|
||||
protected ModelMetadata(Microsoft.AspNetCore.Mvc.ModelBinding.Metadata.ModelMetadataIdentity identity) { }
|
||||
|
|
@ -641,15 +642,15 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
public abstract System.Type BinderType { get; }
|
||||
public abstract Microsoft.AspNetCore.Mvc.ModelBinding.BindingSource BindingSource { get; }
|
||||
public virtual Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata ContainerMetadata { get { throw null; } }
|
||||
public System.Type ContainerType { get { throw null; } }
|
||||
public System.Type? ContainerType { get { throw null; } }
|
||||
public abstract bool ConvertEmptyStringToNull { get; }
|
||||
public abstract string DataTypeName { get; }
|
||||
public abstract string Description { get; }
|
||||
public abstract string DisplayFormatString { get; }
|
||||
public abstract string DisplayName { get; }
|
||||
public abstract string EditFormatString { get; }
|
||||
public abstract Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata ElementMetadata { get; }
|
||||
public System.Type ElementType { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } }
|
||||
public abstract Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata? ElementMetadata { get; }
|
||||
public System.Type? ElementType { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } }
|
||||
public abstract System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<Microsoft.AspNetCore.Mvc.ModelBinding.EnumGroupAndName, string>> EnumGroupedDisplayNamesAndValues { get; }
|
||||
public abstract System.Collections.Generic.IReadOnlyDictionary<string, string> EnumNamesAndValues { get; }
|
||||
public abstract bool HasNonDefaultEditFormat { get; }
|
||||
|
|
@ -671,17 +672,17 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
public Microsoft.AspNetCore.Mvc.ModelBinding.Metadata.ModelMetadataKind MetadataKind { get { throw null; } }
|
||||
public abstract Microsoft.AspNetCore.Mvc.ModelBinding.Metadata.ModelBindingMessageProvider ModelBindingMessageProvider { get; }
|
||||
public System.Type ModelType { get { throw null; } }
|
||||
public string Name { get { throw null; } }
|
||||
public string? Name { get { throw null; } }
|
||||
public abstract string NullDisplayText { get; }
|
||||
public abstract int Order { get; }
|
||||
public string ParameterName { get { throw null; } }
|
||||
public string? ParameterName { get { throw null; } }
|
||||
public abstract string Placeholder { get; }
|
||||
public abstract Microsoft.AspNetCore.Mvc.ModelBinding.ModelPropertyCollection Properties { get; }
|
||||
public abstract Microsoft.AspNetCore.Mvc.ModelBinding.IPropertyFilterProvider PropertyFilterProvider { get; }
|
||||
public abstract System.Func<object, object> PropertyGetter { get; }
|
||||
public string PropertyName { get { throw null; } }
|
||||
public string? PropertyName { get { throw null; } }
|
||||
public abstract System.Action<object, object> PropertySetter { get; }
|
||||
public virtual Microsoft.AspNetCore.Mvc.ModelBinding.Validation.IPropertyValidationFilter PropertyValidationFilter { get { throw null; } }
|
||||
public virtual Microsoft.AspNetCore.Mvc.ModelBinding.Validation.IPropertyValidationFilter? PropertyValidationFilter { get { throw null; } }
|
||||
public abstract bool ShowForDisplay { get; }
|
||||
public abstract bool ShowForEdit { get; }
|
||||
public abstract string SimpleDisplayProperty { get; }
|
||||
|
|
@ -689,8 +690,8 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
public System.Type UnderlyingOrModelType { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } }
|
||||
public abstract bool ValidateChildren { get; }
|
||||
public abstract System.Collections.Generic.IReadOnlyList<object> ValidatorMetadata { get; }
|
||||
public bool Equals(Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata other) { throw null; }
|
||||
public override bool Equals(object obj) { throw null; }
|
||||
public bool Equals(Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata? other) { throw null; }
|
||||
public override bool Equals(object? obj) { throw null; }
|
||||
public string GetDisplayName() { throw null; }
|
||||
public override int GetHashCode() { throw null; }
|
||||
public virtual System.Collections.Generic.IEnumerable<Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata> GetMetadataForProperties(System.Type modelType) { throw null; }
|
||||
|
|
@ -708,7 +709,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
public partial class ModelPropertyCollection : System.Collections.ObjectModel.ReadOnlyCollection<Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata>
|
||||
{
|
||||
public ModelPropertyCollection(System.Collections.Generic.IEnumerable<Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata> properties) : base (default(System.Collections.Generic.IList<Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata>)) { }
|
||||
public Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata this[string propertyName] { get { throw null; } }
|
||||
public Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata? this[string propertyName] { get { throw null; } }
|
||||
}
|
||||
public partial class ModelStateDictionary : System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateEntry>>, System.Collections.Generic.IReadOnlyCollection<System.Collections.Generic.KeyValuePair<string, Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateEntry>>, System.Collections.Generic.IReadOnlyDictionary<string, Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateEntry>, System.Collections.IEnumerable
|
||||
{
|
||||
|
|
@ -724,8 +725,8 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
public Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateDictionary.KeyEnumerable Keys { get { throw null; } }
|
||||
public int MaxAllowedErrors { get { throw null; } set { } }
|
||||
public Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateEntry Root { get { throw null; } }
|
||||
System.Collections.Generic.IEnumerable<string> System.Collections.Generic.IReadOnlyDictionary<System.String,Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateEntry>.Keys { get { throw null; } }
|
||||
System.Collections.Generic.IEnumerable<Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateEntry> System.Collections.Generic.IReadOnlyDictionary<System.String,Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateEntry>.Values { get { throw null; } }
|
||||
System.Collections.Generic.IEnumerable<string> System.Collections.Generic.IReadOnlyDictionary<string, Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateEntry>.Keys { get { throw null; } }
|
||||
System.Collections.Generic.IEnumerable<Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateEntry> System.Collections.Generic.IReadOnlyDictionary<string, Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateEntry>.Values { get { throw null; } }
|
||||
public Microsoft.AspNetCore.Mvc.ModelBinding.ModelValidationState ValidationState { get { throw null; } }
|
||||
public Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateDictionary.ValueEnumerable Values { get { throw null; } }
|
||||
public void AddModelError(string key, System.Exception exception, Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata metadata) { }
|
||||
|
|
@ -742,14 +743,14 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
public void Merge(Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateDictionary dictionary) { }
|
||||
public bool Remove(string key) { throw null; }
|
||||
public void SetModelValue(string key, Microsoft.AspNetCore.Mvc.ModelBinding.ValueProviderResult valueProviderResult) { }
|
||||
public void SetModelValue(string key, object rawValue, string attemptedValue) { }
|
||||
public void SetModelValue(string key, object? rawValue, string attemptedValue) { }
|
||||
public static bool StartsWithPrefix(string prefix, string key) { throw null; }
|
||||
System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<string, Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateEntry>> System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String,Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateEntry>>.GetEnumerator() { throw null; }
|
||||
System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<string, Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateEntry>> System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateEntry>>.GetEnumerator() { throw null; }
|
||||
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; }
|
||||
public bool TryAddModelError(string key, System.Exception exception, Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata metadata) { throw null; }
|
||||
public bool TryAddModelError(string key, string errorMessage) { throw null; }
|
||||
public bool TryAddModelException(string key, System.Exception exception) { throw null; }
|
||||
public bool TryGetValue(string key, out Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateEntry value) { throw null; }
|
||||
public bool TryGetValue(string key, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateEntry? value) { throw null; }
|
||||
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
|
||||
public partial struct Enumerator : System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<string, Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateEntry>>, System.Collections.IEnumerator, System.IDisposable
|
||||
{
|
||||
|
|
@ -769,7 +770,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
private readonly int _dummyPrimitive;
|
||||
public KeyEnumerable(Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateDictionary dictionary) { throw null; }
|
||||
public Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateDictionary.KeyEnumerator GetEnumerator() { throw null; }
|
||||
System.Collections.Generic.IEnumerator<string> System.Collections.Generic.IEnumerable<System.String>.GetEnumerator() { throw null; }
|
||||
System.Collections.Generic.IEnumerator<string> System.Collections.Generic.IEnumerable<string>.GetEnumerator() { throw null; }
|
||||
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; }
|
||||
}
|
||||
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
|
||||
|
|
@ -791,7 +792,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
private readonly int _dummyPrimitive;
|
||||
public PrefixEnumerable(Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateDictionary dictionary, string prefix) { throw null; }
|
||||
public Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateDictionary.Enumerator GetEnumerator() { throw null; }
|
||||
System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<string, Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateEntry>> System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String,Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateEntry>>.GetEnumerator() { throw null; }
|
||||
System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<string, Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateEntry>> System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateEntry>>.GetEnumerator() { throw null; }
|
||||
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; }
|
||||
}
|
||||
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
|
||||
|
|
@ -820,13 +821,13 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
public abstract partial class ModelStateEntry
|
||||
{
|
||||
protected ModelStateEntry() { }
|
||||
public string AttemptedValue { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public abstract System.Collections.Generic.IReadOnlyList<Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateEntry> Children { get; }
|
||||
public string? AttemptedValue { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public abstract System.Collections.Generic.IReadOnlyList<Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateEntry>? Children { get; }
|
||||
public Microsoft.AspNetCore.Mvc.ModelBinding.ModelErrorCollection Errors { get { throw null; } }
|
||||
public abstract bool IsContainerNode { get; }
|
||||
public object RawValue { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public object? RawValue { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public Microsoft.AspNetCore.Mvc.ModelBinding.ModelValidationState ValidationState { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public abstract Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateEntry GetModelStateForProperty(string propertyName);
|
||||
public abstract Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateEntry? GetModelStateForProperty(string propertyName);
|
||||
}
|
||||
public enum ModelValidationState
|
||||
{
|
||||
|
|
@ -859,11 +860,11 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
public ValueProviderResult(Microsoft.Extensions.Primitives.StringValues values) { throw null; }
|
||||
public ValueProviderResult(Microsoft.Extensions.Primitives.StringValues values, System.Globalization.CultureInfo culture) { throw null; }
|
||||
public System.Globalization.CultureInfo Culture { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } }
|
||||
public string FirstValue { get { throw null; } }
|
||||
public string? FirstValue { get { throw null; } }
|
||||
public int Length { get { throw null; } }
|
||||
public Microsoft.Extensions.Primitives.StringValues Values { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } }
|
||||
public bool Equals(Microsoft.AspNetCore.Mvc.ModelBinding.ValueProviderResult other) { throw null; }
|
||||
public override bool Equals(object obj) { throw null; }
|
||||
public override bool Equals(object? obj) { throw null; }
|
||||
public System.Collections.Generic.IEnumerator<string> GetEnumerator() { throw null; }
|
||||
public override int GetHashCode() { throw null; }
|
||||
public static bool operator ==(Microsoft.AspNetCore.Mvc.ModelBinding.ValueProviderResult x, Microsoft.AspNetCore.Mvc.ModelBinding.ValueProviderResult y) { throw null; }
|
||||
|
|
@ -896,14 +897,14 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Metadata
|
|||
{
|
||||
private readonly object _dummy;
|
||||
private readonly int _dummyPrimitive;
|
||||
public System.Type ContainerType { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } }
|
||||
public System.Type? ContainerType { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } }
|
||||
public Microsoft.AspNetCore.Mvc.ModelBinding.Metadata.ModelMetadataKind MetadataKind { get { throw null; } }
|
||||
public System.Type ModelType { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } }
|
||||
public string Name { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } }
|
||||
public System.Reflection.ParameterInfo ParameterInfo { get { throw null; } }
|
||||
public System.Reflection.PropertyInfo PropertyInfo { get { throw null; } }
|
||||
public string? Name { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } }
|
||||
public System.Reflection.ParameterInfo? ParameterInfo { get { throw null; } }
|
||||
public System.Reflection.PropertyInfo? PropertyInfo { get { throw null; } }
|
||||
public bool Equals(Microsoft.AspNetCore.Mvc.ModelBinding.Metadata.ModelMetadataIdentity other) { throw null; }
|
||||
public override bool Equals(object obj) { throw null; }
|
||||
public override bool Equals(object? obj) { throw null; }
|
||||
public static Microsoft.AspNetCore.Mvc.ModelBinding.Metadata.ModelMetadataIdentity ForParameter(System.Reflection.ParameterInfo parameter) { throw null; }
|
||||
public static Microsoft.AspNetCore.Mvc.ModelBinding.Metadata.ModelMetadataIdentity ForParameter(System.Reflection.ParameterInfo parameter, System.Type modelType) { throw null; }
|
||||
public static Microsoft.AspNetCore.Mvc.ModelBinding.Metadata.ModelMetadataIdentity ForProperty(System.Reflection.PropertyInfo propertyInfo, System.Type modelType, System.Type containerType) { throw null; }
|
||||
|
|
@ -1000,17 +1001,19 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Validation
|
|||
public ValidationEntry(Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata metadata, string key, object model) { throw null; }
|
||||
public string Key { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } }
|
||||
public Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata Metadata { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } }
|
||||
public object Model { get { throw null; } }
|
||||
public object? Model { get { throw null; } }
|
||||
}
|
||||
public partial class ValidationStateDictionary : System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<object, Microsoft.AspNetCore.Mvc.ModelBinding.Validation.ValidationStateEntry>>, System.Collections.Generic.IDictionary<object, Microsoft.AspNetCore.Mvc.ModelBinding.Validation.ValidationStateEntry>, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<object, Microsoft.AspNetCore.Mvc.ModelBinding.Validation.ValidationStateEntry>>, System.Collections.Generic.IReadOnlyCollection<System.Collections.Generic.KeyValuePair<object, Microsoft.AspNetCore.Mvc.ModelBinding.Validation.ValidationStateEntry>>, System.Collections.Generic.IReadOnlyDictionary<object, Microsoft.AspNetCore.Mvc.ModelBinding.Validation.ValidationStateEntry>, System.Collections.IEnumerable
|
||||
{
|
||||
public ValidationStateDictionary() { }
|
||||
public int Count { get { throw null; } }
|
||||
public bool IsReadOnly { get { throw null; } }
|
||||
public Microsoft.AspNetCore.Mvc.ModelBinding.Validation.ValidationStateEntry this[object key] { get { throw null; } set { } }
|
||||
public Microsoft.AspNetCore.Mvc.ModelBinding.Validation.ValidationStateEntry? this[object key] { get { throw null; } set { } }
|
||||
public System.Collections.Generic.ICollection<object> Keys { get { throw null; } }
|
||||
System.Collections.Generic.IEnumerable<object> System.Collections.Generic.IReadOnlyDictionary<System.Object,Microsoft.AspNetCore.Mvc.ModelBinding.Validation.ValidationStateEntry>.Keys { get { throw null; } }
|
||||
System.Collections.Generic.IEnumerable<Microsoft.AspNetCore.Mvc.ModelBinding.Validation.ValidationStateEntry> System.Collections.Generic.IReadOnlyDictionary<System.Object,Microsoft.AspNetCore.Mvc.ModelBinding.Validation.ValidationStateEntry>.Values { get { throw null; } }
|
||||
Microsoft.AspNetCore.Mvc.ModelBinding.Validation.ValidationStateEntry System.Collections.Generic.IDictionary<object, Microsoft.AspNetCore.Mvc.ModelBinding.Validation.ValidationStateEntry>.this[object key] { get { throw null; } set { } }
|
||||
Microsoft.AspNetCore.Mvc.ModelBinding.Validation.ValidationStateEntry System.Collections.Generic.IReadOnlyDictionary<object, Microsoft.AspNetCore.Mvc.ModelBinding.Validation.ValidationStateEntry>.this[object key] { get { throw null; } }
|
||||
System.Collections.Generic.IEnumerable<object> System.Collections.Generic.IReadOnlyDictionary<object, Microsoft.AspNetCore.Mvc.ModelBinding.Validation.ValidationStateEntry>.Keys { get { throw null; } }
|
||||
System.Collections.Generic.IEnumerable<Microsoft.AspNetCore.Mvc.ModelBinding.Validation.ValidationStateEntry> System.Collections.Generic.IReadOnlyDictionary<object, Microsoft.AspNetCore.Mvc.ModelBinding.Validation.ValidationStateEntry>.Values { get { throw null; } }
|
||||
public System.Collections.Generic.ICollection<Microsoft.AspNetCore.Mvc.ModelBinding.Validation.ValidationStateEntry> Values { get { throw null; } }
|
||||
public void Add(System.Collections.Generic.KeyValuePair<object, Microsoft.AspNetCore.Mvc.ModelBinding.Validation.ValidationStateEntry> item) { }
|
||||
public void Add(object key, Microsoft.AspNetCore.Mvc.ModelBinding.Validation.ValidationStateEntry value) { }
|
||||
|
|
@ -1022,7 +1025,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Validation
|
|||
public bool Remove(System.Collections.Generic.KeyValuePair<object, Microsoft.AspNetCore.Mvc.ModelBinding.Validation.ValidationStateEntry> item) { throw null; }
|
||||
public bool Remove(object key) { throw null; }
|
||||
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; }
|
||||
public bool TryGetValue(object key, out Microsoft.AspNetCore.Mvc.ModelBinding.Validation.ValidationStateEntry value) { throw null; }
|
||||
public bool TryGetValue(object key, [System.Diagnostics.CodeAnalysis.MaybeNullWhenAttribute(false)] out Microsoft.AspNetCore.Mvc.ModelBinding.Validation.ValidationStateEntry value) { throw null; }
|
||||
}
|
||||
public partial class ValidationStateEntry
|
||||
{
|
||||
|
|
@ -1050,25 +1053,25 @@ namespace Microsoft.AspNetCore.Mvc.Routing
|
|||
public int Order { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public bool SuppressLinkGeneration { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public bool SuppressPathMatching { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public string Template { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public string? Template { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
}
|
||||
public partial class UrlActionContext
|
||||
{
|
||||
public UrlActionContext() { }
|
||||
public string Action { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public string Controller { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public string Fragment { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public string Host { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public string Protocol { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public object Values { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public string? Action { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public string? Controller { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public string? Fragment { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public string? Host { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public string? Protocol { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public object? Values { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
}
|
||||
public partial class UrlRouteContext
|
||||
{
|
||||
public UrlRouteContext() { }
|
||||
public string Fragment { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public string Host { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public string Protocol { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public string RouteName { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public object Values { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public string? Fragment { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public string? Host { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public string? Protocol { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public string? RouteName { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
public object? Values { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute] set { } }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,42 +38,42 @@ namespace Microsoft.AspNetCore.Mvc.Abstractions
|
|||
/// <summary>
|
||||
/// Gets or sets the <see cref="Routing.AttributeRouteInfo"/>.
|
||||
/// </summary>
|
||||
public AttributeRouteInfo AttributeRouteInfo { get; set; }
|
||||
public AttributeRouteInfo? AttributeRouteInfo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The set of constraints for this action. Must all be satisfied for the action to be selected.
|
||||
/// </summary>
|
||||
public IList<IActionConstraintMetadata> ActionConstraints { get; set; }
|
||||
public IList<IActionConstraintMetadata>? ActionConstraints { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the endpoint metadata for this action.
|
||||
/// This API is meant for infrastructure and should not be used by application code.
|
||||
/// </summary>
|
||||
public IList<object> EndpointMetadata { get; set; }
|
||||
public IList<object> EndpointMetadata { get; set; } = Array.Empty<ParameterDescriptor>();
|
||||
|
||||
/// <summary>
|
||||
/// The set of parameters associated with this action.
|
||||
/// </summary>
|
||||
public IList<ParameterDescriptor> Parameters { get; set; }
|
||||
public IList<ParameterDescriptor> Parameters { get; set; } = Array.Empty<ParameterDescriptor>();
|
||||
|
||||
/// <summary>
|
||||
/// The set of properties which are model bound.
|
||||
/// </summary>
|
||||
public IList<ParameterDescriptor> BoundProperties { get; set; }
|
||||
public IList<ParameterDescriptor> BoundProperties { get; set; } = Array.Empty<ParameterDescriptor>();
|
||||
|
||||
/// <summary>
|
||||
/// The set of filters associated with this action.
|
||||
/// </summary>
|
||||
public IList<FilterDescriptor> FilterDescriptors { get; set; }
|
||||
public IList<FilterDescriptor> FilterDescriptors { get; set; } = Array.Empty<FilterDescriptor>();
|
||||
|
||||
/// <summary>
|
||||
/// A friendly name for this action.
|
||||
/// </summary>
|
||||
public virtual string DisplayName { get; set; }
|
||||
public virtual string? DisplayName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Stores arbitrary metadata properties associated with the <see cref="ActionDescriptor"/>.
|
||||
/// </summary>
|
||||
public IDictionary<object, object> Properties { get; set; }
|
||||
public IDictionary<object, object> Properties { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,14 +24,13 @@ namespace Microsoft.AspNetCore.Mvc.Abstractions
|
|||
throw new ArgumentNullException(nameof(actionDescriptor));
|
||||
}
|
||||
|
||||
object value;
|
||||
if (actionDescriptor.Properties.TryGetValue(typeof(T), out value))
|
||||
if (actionDescriptor.Properties.TryGetValue(typeof(T), out var value))
|
||||
{
|
||||
return (T)value;
|
||||
}
|
||||
else
|
||||
{
|
||||
return default(T);
|
||||
return default!;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,6 +32,6 @@ namespace Microsoft.AspNetCore.Mvc.Abstractions
|
|||
/// <summary>
|
||||
/// Gets or sets the <see cref="IActionInvoker"/> that will be used to invoke <see cref="ActionContext" />
|
||||
/// </summary>
|
||||
public IActionInvoker Result { get; set; }
|
||||
public IActionInvoker? Result { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,16 +14,16 @@ namespace Microsoft.AspNetCore.Mvc.Abstractions
|
|||
/// <summary>
|
||||
/// Gets or sets the parameter name.
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
public string Name { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the type of the parameter.
|
||||
/// </summary>
|
||||
public Type ParameterType { get; set; }
|
||||
public Type ParameterType { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the <see cref="ModelBinding.BindingInfo"/> for the parameter.
|
||||
/// </summary>
|
||||
public BindingInfo BindingInfo { get; set; }
|
||||
public BindingInfo BindingInfo { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.AspNetCore.Routing;
|
||||
|
||||
|
|
@ -15,16 +16,16 @@ namespace Microsoft.AspNetCore.Mvc.ActionConstraints
|
|||
/// The list of <see cref="ActionSelectorCandidate"/>. This includes all actions that are valid for the current
|
||||
/// request, as well as their constraints.
|
||||
/// </summary>
|
||||
public IReadOnlyList<ActionSelectorCandidate> Candidates { get; set; }
|
||||
public IReadOnlyList<ActionSelectorCandidate> Candidates { get; set; } = Array.Empty<ActionSelectorCandidate>();
|
||||
|
||||
/// <summary>
|
||||
/// The current <see cref="ActionSelectorCandidate"/>.
|
||||
/// </summary>
|
||||
public ActionSelectorCandidate CurrentCandidate { get; set; }
|
||||
public ActionSelectorCandidate CurrentCandidate { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="RouteContext"/>.
|
||||
/// </summary>
|
||||
public RouteContext RouteContext { get; set; }
|
||||
public RouteContext RouteContext { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
|
|
@ -28,7 +28,7 @@ namespace Microsoft.AspNetCore.Mvc.ActionConstraints
|
|||
/// <summary>
|
||||
/// The <see cref="IActionConstraint"/> associated with <see cref="Metadata"/>.
|
||||
/// </summary>
|
||||
public IActionConstraint Constraint { get; set; }
|
||||
public IActionConstraint Constraint { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="IActionConstraintMetadata"/> instance.
|
||||
|
|
|
|||
|
|
@ -31,10 +31,10 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
/// <param name="actionContext">The <see cref="ActionContext"/> to copy.</param>
|
||||
public ActionContext(ActionContext actionContext)
|
||||
: this(
|
||||
actionContext?.HttpContext,
|
||||
actionContext?.RouteData,
|
||||
actionContext?.ActionDescriptor,
|
||||
actionContext?.ModelState)
|
||||
actionContext.HttpContext,
|
||||
actionContext.RouteData,
|
||||
actionContext.ActionDescriptor,
|
||||
actionContext.ModelState)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -97,10 +97,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
/// <remarks>
|
||||
/// The property setter is provided for unit test purposes only.
|
||||
/// </remarks>
|
||||
public ActionDescriptor ActionDescriptor
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
public ActionDescriptor ActionDescriptor { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the <see cref="Http.HttpContext"/> for the current request.
|
||||
|
|
@ -108,18 +105,12 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
/// <remarks>
|
||||
/// The property setter is provided for unit test purposes only.
|
||||
/// </remarks>
|
||||
public HttpContext HttpContext
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
public HttpContext HttpContext { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the <see cref="ModelStateDictionary"/>.
|
||||
/// </summary>
|
||||
public ModelStateDictionary ModelState
|
||||
{
|
||||
get;
|
||||
}
|
||||
public ModelStateDictionary ModelState { get; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the <see cref="AspNetCore.Routing.RouteData"/> for the current request.
|
||||
|
|
@ -127,9 +118,6 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
/// <remarks>
|
||||
/// The property setter is provided for unit test purposes only.
|
||||
/// </remarks>
|
||||
public RouteData RouteData
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
public RouteData RouteData { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,17 +16,17 @@ namespace Microsoft.AspNetCore.Mvc.ApiExplorer
|
|||
/// <summary>
|
||||
/// Gets or sets <see cref="ActionDescriptor"/> for this api.
|
||||
/// </summary>
|
||||
public ActionDescriptor ActionDescriptor { get; set; }
|
||||
public ActionDescriptor ActionDescriptor { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets group name for this api.
|
||||
/// </summary>
|
||||
public string GroupName { get; set; }
|
||||
public string? GroupName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the supported HTTP method for this api, or null if all HTTP methods are supported.
|
||||
/// </summary>
|
||||
public string HttpMethod { get; set; }
|
||||
public string? HttpMethod { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a list of <see cref="ApiParameterDescription"/> for this api.
|
||||
|
|
@ -41,7 +41,7 @@ namespace Microsoft.AspNetCore.Mvc.ApiExplorer
|
|||
/// <summary>
|
||||
/// Gets or sets relative url path template (relative to application root) for this api.
|
||||
/// </summary>
|
||||
public string RelativePath { get; set; }
|
||||
public string RelativePath { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the list of possible formats for a request.
|
||||
|
|
|
|||
|
|
@ -15,37 +15,37 @@ namespace Microsoft.AspNetCore.Mvc.ApiExplorer
|
|||
/// <summary>
|
||||
/// Gets or sets the <see cref="ModelMetadata"/>.
|
||||
/// </summary>
|
||||
public ModelMetadata ModelMetadata { get; set; }
|
||||
public ModelMetadata ModelMetadata { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the name.
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
public string Name { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the <see cref="ApiParameterRouteInfo"/>.
|
||||
/// </summary>
|
||||
public ApiParameterRouteInfo RouteInfo { get; set; }
|
||||
public ApiParameterRouteInfo? RouteInfo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the <see cref="BindingSource"/>.
|
||||
/// </summary>
|
||||
public BindingSource Source { get; set; }
|
||||
public BindingSource Source { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the <see cref="BindingInfo"/>.
|
||||
/// </summary>
|
||||
public BindingInfo BindingInfo { get; set; }
|
||||
public BindingInfo? BindingInfo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the parameter type.
|
||||
/// </summary>
|
||||
public Type Type { get; set; }
|
||||
public Type Type { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the parameter descriptor.
|
||||
/// </summary>
|
||||
public ParameterDescriptor ParameterDescriptor { get; set; }
|
||||
public ParameterDescriptor ParameterDescriptor { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value that determines if the parameter is required.
|
||||
|
|
@ -63,6 +63,6 @@ namespace Microsoft.AspNetCore.Mvc.ApiExplorer
|
|||
/// <summary>
|
||||
/// Gets or sets the default value for a parameter.
|
||||
/// </summary>
|
||||
public object DefaultValue { get; set; }
|
||||
public object? DefaultValue { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -18,12 +18,12 @@ namespace Microsoft.AspNetCore.Mvc.ApiExplorer
|
|||
/// Route constraints are only applied when a value is bound from a URL's path. See
|
||||
/// <see cref="ApiParameterDescription.Source"/> for the data source considered.
|
||||
/// </remarks>
|
||||
public IEnumerable<IRouteConstraint> Constraints { get; set; }
|
||||
public IEnumerable<IRouteConstraint>? Constraints { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the default value for the parameter.
|
||||
/// </summary>
|
||||
public object DefaultValue { get; set; }
|
||||
public object? DefaultValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether not a parameter is considered optional by routing.
|
||||
|
|
|
|||
|
|
@ -13,11 +13,11 @@ namespace Microsoft.AspNetCore.Mvc.ApiExplorer
|
|||
/// <summary>
|
||||
/// The formatter used to read this request.
|
||||
/// </summary>
|
||||
public IInputFormatter Formatter { get; set; }
|
||||
public IInputFormatter Formatter { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// The media type of the request.
|
||||
/// </summary>
|
||||
public string MediaType { get; set; }
|
||||
public string MediaType { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
|
|
@ -13,11 +13,11 @@ namespace Microsoft.AspNetCore.Mvc.ApiExplorer
|
|||
/// <summary>
|
||||
/// Gets or sets the formatter used to output this response.
|
||||
/// </summary>
|
||||
public IOutputFormatter Formatter { get; set; }
|
||||
public IOutputFormatter Formatter { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the media type of the response.
|
||||
/// </summary>
|
||||
public string MediaType { get; set; }
|
||||
public string MediaType { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ namespace Microsoft.AspNetCore.Mvc.ApiExplorer
|
|||
/// <remarks>
|
||||
/// Will be null if <see cref="Type"/> is null or void.
|
||||
/// </remarks>
|
||||
public ModelMetadata ModelMetadata { get; set; }
|
||||
public ModelMetadata? ModelMetadata { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the CLR data type of the response or null.
|
||||
|
|
@ -33,7 +33,7 @@ namespace Microsoft.AspNetCore.Mvc.ApiExplorer
|
|||
/// <c>Microsoft.AspNetCore.Mvc.ProducesAttribute</c> or <c>Microsoft.AspNetCore.Mvc.ProducesResponseTypeAttribute</c> on an action method
|
||||
/// to specify a response type.
|
||||
/// </remarks>
|
||||
public Type Type { get; set; }
|
||||
public Type? Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the HTTP response status code.
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@ namespace Microsoft.AspNetCore.Mvc.Filters
|
|||
/// </summary>
|
||||
public class ActionExecutedContext : FilterContext
|
||||
{
|
||||
private Exception _exception;
|
||||
private ExceptionDispatchInfo _exceptionDispatchInfo;
|
||||
private Exception? _exception;
|
||||
private ExceptionDispatchInfo? _exceptionDispatchInfo;
|
||||
|
||||
/// <summary>
|
||||
/// Instantiates a new <see cref="ActionExecutingContext"/> instance.
|
||||
|
|
@ -44,7 +44,7 @@ namespace Microsoft.AspNetCore.Mvc.Filters
|
|||
/// Gets or sets the <see cref="System.Exception"/> caught while executing the action or action filters, if
|
||||
/// any.
|
||||
/// </summary>
|
||||
public virtual Exception Exception
|
||||
public virtual Exception? Exception
|
||||
{
|
||||
get
|
||||
{
|
||||
|
|
@ -69,7 +69,7 @@ namespace Microsoft.AspNetCore.Mvc.Filters
|
|||
/// Gets or sets the <see cref="System.Runtime.ExceptionServices.ExceptionDispatchInfo"/> for the
|
||||
/// <see cref="Exception"/>, if an <see cref="System.Exception"/> was caught and this information captured.
|
||||
/// </summary>
|
||||
public virtual ExceptionDispatchInfo ExceptionDispatchInfo
|
||||
public virtual ExceptionDispatchInfo? ExceptionDispatchInfo
|
||||
{
|
||||
get
|
||||
{
|
||||
|
|
@ -91,6 +91,6 @@ namespace Microsoft.AspNetCore.Mvc.Filters
|
|||
/// <summary>
|
||||
/// Gets or sets the <see cref="IActionResult"/>.
|
||||
/// </summary>
|
||||
public virtual IActionResult Result { get; set; }
|
||||
public virtual IActionResult Result { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ namespace Microsoft.AspNetCore.Mvc.Filters
|
|||
/// Gets or sets the <see cref="IActionResult"/> to execute. Setting <see cref="Result"/> to a non-<c>null</c>
|
||||
/// value inside an action filter will short-circuit the action and any remaining action filters.
|
||||
/// </summary>
|
||||
public virtual IActionResult Result { get; set; }
|
||||
public virtual IActionResult? Result { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the arguments to pass when invoking the action. Keys are parameter names.
|
||||
|
|
|
|||
|
|
@ -27,6 +27,6 @@ namespace Microsoft.AspNetCore.Mvc.Filters
|
|||
/// Gets or sets the result of the request. Setting <see cref="Result"/> to a non-<c>null</c> value inside
|
||||
/// an authorization filter will short-circuit the remainder of the filter pipeline.
|
||||
/// </summary>
|
||||
public virtual IActionResult Result { get; set; }
|
||||
public virtual IActionResult? Result { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,8 +13,8 @@ namespace Microsoft.AspNetCore.Mvc.Filters
|
|||
/// </summary>
|
||||
public class ExceptionContext : FilterContext
|
||||
{
|
||||
private Exception _exception;
|
||||
private ExceptionDispatchInfo _exceptionDispatchInfo;
|
||||
private Exception? _exception;
|
||||
private ExceptionDispatchInfo? _exceptionDispatchInfo;
|
||||
|
||||
/// <summary>
|
||||
/// Instantiates a new <see cref="ExceptionContext"/> instance.
|
||||
|
|
@ -39,7 +39,7 @@ namespace Microsoft.AspNetCore.Mvc.Filters
|
|||
}
|
||||
else
|
||||
{
|
||||
return _exception;
|
||||
return _exception!;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -54,7 +54,7 @@ namespace Microsoft.AspNetCore.Mvc.Filters
|
|||
/// Gets or sets the <see cref="System.Runtime.ExceptionServices.ExceptionDispatchInfo"/> for the
|
||||
/// <see cref="Exception"/>, if this information was captured.
|
||||
/// </summary>
|
||||
public virtual ExceptionDispatchInfo ExceptionDispatchInfo
|
||||
public virtual ExceptionDispatchInfo? ExceptionDispatchInfo
|
||||
{
|
||||
get
|
||||
{
|
||||
|
|
@ -76,6 +76,6 @@ namespace Microsoft.AspNetCore.Mvc.Filters
|
|||
/// <summary>
|
||||
/// Gets or sets the <see cref="IActionResult"/>.
|
||||
/// </summary>
|
||||
public virtual IActionResult Result { get; set; }
|
||||
public virtual IActionResult? Result { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace Microsoft.AspNetCore.Mvc.Filters
|
||||
{
|
||||
|
|
@ -81,6 +82,7 @@ namespace Microsoft.AspNetCore.Mvc.Filters
|
|||
/// <returns>The implementation of <typeparamref name="TMetadata"/> applied to the action associated with
|
||||
/// the <see cref="FilterContext"/>
|
||||
/// </returns>
|
||||
[return: MaybeNull]
|
||||
public TMetadata FindEffectivePolicy<TMetadata>() where TMetadata : IFilterMetadata
|
||||
{
|
||||
// The most specific policy is the one closest to the action (nearest the end of the list).
|
||||
|
|
@ -93,7 +95,7 @@ namespace Microsoft.AspNetCore.Mvc.Filters
|
|||
}
|
||||
}
|
||||
|
||||
return default(TMetadata);
|
||||
return default;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,12 +48,12 @@ namespace Microsoft.AspNetCore.Mvc.Filters
|
|||
/// <summary>
|
||||
/// Gets the <see cref="FilterDescriptor"/> containing the filter metadata.
|
||||
/// </summary>
|
||||
public FilterDescriptor Descriptor { get; }
|
||||
public FilterDescriptor Descriptor { get; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the executable <see cref="IFilterMetadata"/> associated with <see cref="Descriptor"/>.
|
||||
/// </summary>
|
||||
public IFilterMetadata Filter { get; set; }
|
||||
public IFilterMetadata Filter { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether or not <see cref="Filter"/> can be reused across requests.
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@ namespace Microsoft.AspNetCore.Mvc.Filters
|
|||
/// </summary>
|
||||
public class ResourceExecutedContext : FilterContext
|
||||
{
|
||||
private Exception _exception;
|
||||
private ExceptionDispatchInfo _exceptionDispatchInfo;
|
||||
private Exception? _exception;
|
||||
private ExceptionDispatchInfo? _exceptionDispatchInfo;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="ResourceExecutedContext"/>.
|
||||
|
|
@ -44,7 +44,7 @@ namespace Microsoft.AspNetCore.Mvc.Filters
|
|||
/// Setting <see cref="ExceptionHandled"/> to <c>true</c> will also mark the exception as handled.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public virtual Exception Exception
|
||||
public virtual Exception? Exception
|
||||
{
|
||||
get
|
||||
{
|
||||
|
|
@ -77,7 +77,7 @@ namespace Microsoft.AspNetCore.Mvc.Filters
|
|||
/// Setting <see cref="ExceptionHandled"/> to <c>true</c> will also mark the exception as handled.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public virtual ExceptionDispatchInfo ExceptionDispatchInfo
|
||||
public virtual ExceptionDispatchInfo? ExceptionDispatchInfo
|
||||
{
|
||||
get
|
||||
{
|
||||
|
|
@ -115,6 +115,6 @@ namespace Microsoft.AspNetCore.Mvc.Filters
|
|||
/// to resource filters.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public virtual IActionResult Result { get; set; }
|
||||
public virtual IActionResult? Result { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -40,7 +40,7 @@ namespace Microsoft.AspNetCore.Mvc.Filters
|
|||
/// Setting <see cref="Result"/> to a non-<c>null</c> value inside a resource filter will
|
||||
/// short-circuit execution of additional resource filters and the action itself.
|
||||
/// </remarks>
|
||||
public virtual IActionResult Result { get; set; }
|
||||
public virtual IActionResult? Result { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the list of <see cref="IValueProviderFactory"/> instances used by model binding.
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@ namespace Microsoft.AspNetCore.Mvc.Filters
|
|||
/// </summary>
|
||||
public class ResultExecutedContext : FilterContext
|
||||
{
|
||||
private Exception _exception;
|
||||
private ExceptionDispatchInfo _exceptionDispatchInfo;
|
||||
private Exception? _exception;
|
||||
private ExceptionDispatchInfo? _exceptionDispatchInfo;
|
||||
|
||||
/// <summary>
|
||||
/// Instantiates a new <see cref="ResultExecutedContext"/> instance.
|
||||
|
|
@ -55,7 +55,7 @@ namespace Microsoft.AspNetCore.Mvc.Filters
|
|||
/// Gets or sets the <see cref="System.Exception"/> caught while executing the result or result filters, if
|
||||
/// any.
|
||||
/// </summary>
|
||||
public virtual Exception Exception
|
||||
public virtual Exception? Exception
|
||||
{
|
||||
get
|
||||
{
|
||||
|
|
@ -80,7 +80,7 @@ namespace Microsoft.AspNetCore.Mvc.Filters
|
|||
/// Gets or sets the <see cref="System.Runtime.ExceptionServices.ExceptionDispatchInfo"/> for the
|
||||
/// <see cref="Exception"/>, if an <see cref="System.Exception"/> was caught and this information captured.
|
||||
/// </summary>
|
||||
public virtual ExceptionDispatchInfo ExceptionDispatchInfo
|
||||
public virtual ExceptionDispatchInfo? ExceptionDispatchInfo
|
||||
{
|
||||
get
|
||||
{
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ namespace Microsoft.AspNetCore.Mvc.Formatters
|
|||
/// Represents a collection of formatters.
|
||||
/// </summary>
|
||||
/// <typeparam name="TFormatter">The type of formatters in the collection.</typeparam>
|
||||
public class FormatterCollection<TFormatter> : Collection<TFormatter>
|
||||
public class FormatterCollection<TFormatter> : Collection<TFormatter> where TFormatter : notnull
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="FormatterCollection{TFormatter}"/> class that is empty.
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ namespace Microsoft.AspNetCore.Mvc.Formatters
|
|||
/// <value>
|
||||
/// <c>null</c> if <see cref="HasError"/> is <c>true</c>.
|
||||
/// </value>
|
||||
public object Model { get; }
|
||||
public object? Model { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns an <see cref="InputFormatterResult"/> indicating the <see cref="IInputFormatter.ReadAsync"/>
|
||||
|
|
|
|||
|
|
@ -53,11 +53,11 @@ namespace Microsoft.AspNetCore.Mvc.Formatters
|
|||
/// <summary>
|
||||
/// Gets or sets the object to write to the response.
|
||||
/// </summary>
|
||||
public virtual object Object { get; protected set; }
|
||||
public virtual object? Object { get; protected set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the <see cref="Type"/> of the object to write to the response.
|
||||
/// </summary>
|
||||
public virtual Type ObjectType { get; protected set; }
|
||||
public virtual Type? ObjectType { get; protected set; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ Microsoft.AspNetCore.Mvc.IActionResult</Description>
|
|||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
<PackageTags>aspnetcore;aspnetcoremvc</PackageTags>
|
||||
<IsPackable>false</IsPackable>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
@ -20,8 +21,4 @@ Microsoft.AspNetCore.Mvc.IActionResult</Description>
|
|||
<Reference Include="Microsoft.Net.Http.Headers" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Label="Shared Source">
|
||||
<Compile Include="$(SharedSourceRoot)HashCodeCombiner\*.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
/// </summary>
|
||||
public class BindingInfo
|
||||
{
|
||||
private Type _binderType;
|
||||
private Type? _binderType;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="BindingInfo"/>.
|
||||
|
|
@ -44,12 +44,12 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
/// <summary>
|
||||
/// Gets or sets the <see cref="ModelBinding.BindingSource"/>.
|
||||
/// </summary>
|
||||
public BindingSource BindingSource { get; set; }
|
||||
public BindingSource? BindingSource { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the binder model name.
|
||||
/// </summary>
|
||||
public string BinderModelName { get; set; }
|
||||
public string? BinderModelName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the <see cref="Type"/> of the <see cref="IModelBinder"/> implementation used to bind the
|
||||
|
|
@ -59,7 +59,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
/// Also set <see cref="BindingSource"/> if the specified <see cref="IModelBinder"/> implementation does not
|
||||
/// use values from form data, route values or the query string.
|
||||
/// </remarks>
|
||||
public Type BinderType
|
||||
public Type? BinderType
|
||||
{
|
||||
get => _binderType;
|
||||
set
|
||||
|
|
@ -80,13 +80,13 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
/// <summary>
|
||||
/// Gets or sets the <see cref="ModelBinding.IPropertyFilterProvider"/>.
|
||||
/// </summary>
|
||||
public IPropertyFilterProvider PropertyFilterProvider { get; set; }
|
||||
public IPropertyFilterProvider? PropertyFilterProvider { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a predicate which determines whether or not the model should be bound based on state
|
||||
/// from the current request.
|
||||
/// </summary>
|
||||
public Func<ActionContext, bool> RequestPredicate { get; set; }
|
||||
public Func<ActionContext, bool>? RequestPredicate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the value which decides if empty bodies are treated as valid inputs.
|
||||
|
|
@ -104,7 +104,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
/// <param name="attributes">A collection of attributes which are used to construct <see cref="BindingInfo"/>
|
||||
/// </param>
|
||||
/// <returns>A new instance of <see cref="BindingInfo"/>.</returns>
|
||||
public static BindingInfo GetBindingInfo(IEnumerable<object> attributes)
|
||||
public static BindingInfo? GetBindingInfo(IEnumerable<object> attributes)
|
||||
{
|
||||
var bindingInfo = new BindingInfo();
|
||||
var isBindingInfoPresent = false;
|
||||
|
|
@ -182,7 +182,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
/// <param name="attributes">A collection of attributes which are used to construct <see cref="BindingInfo"/>.</param>
|
||||
/// <param name="modelMetadata">The <see cref="ModelMetadata"/>.</param>
|
||||
/// <returns>A new instance of <see cref="BindingInfo"/> if any binding metadata was discovered; otherwise or <see langword="null"/>.</returns>
|
||||
public static BindingInfo GetBindingInfo(IEnumerable<object> attributes, ModelMetadata modelMetadata)
|
||||
public static BindingInfo? GetBindingInfo(IEnumerable<object> attributes, ModelMetadata modelMetadata)
|
||||
{
|
||||
if (attributes == null)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
/// A metadata object representing a source of data for model binding.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("Source: {DisplayName}")]
|
||||
public class BindingSource : IEquatable<BindingSource>
|
||||
public class BindingSource : IEquatable<BindingSource?>
|
||||
{
|
||||
/// <summary>
|
||||
/// A <see cref="BindingSource"/> for the request body.
|
||||
|
|
@ -210,13 +210,13 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool Equals(BindingSource other)
|
||||
public bool Equals(BindingSource? other)
|
||||
{
|
||||
return string.Equals(other?.Id, Id, StringComparison.Ordinal);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool Equals(object obj)
|
||||
public override bool Equals(object? obj)
|
||||
{
|
||||
return Equals(obj as BindingSource);
|
||||
}
|
||||
|
|
@ -228,7 +228,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public static bool operator ==(BindingSource s1, BindingSource s2)
|
||||
public static bool operator ==(BindingSource? s1, BindingSource? s2)
|
||||
{
|
||||
if (s1 is null)
|
||||
{
|
||||
|
|
@ -239,7 +239,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public static bool operator !=(BindingSource s1, BindingSource s2)
|
||||
public static bool operator !=(BindingSource? s1, BindingSource? s2)
|
||||
{
|
||||
return !(s1 == s2);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
/// <inheritdoc />
|
||||
public override bool CanAcceptDataFrom(BindingSource bindingSource)
|
||||
{
|
||||
if (bindingSource == null)
|
||||
if (bindingSource is null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(bindingSource));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,6 +15,6 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
/// The <see cref="BindingSource"/> is metadata which can be used to determine which data
|
||||
/// sources are valid for model binding of a property or parameter.
|
||||
/// </remarks>
|
||||
BindingSource BindingSource { get; }
|
||||
BindingSource? BindingSource { get; }
|
||||
}
|
||||
}
|
||||
|
|
@ -17,28 +17,28 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Metadata
|
|||
/// <value>
|
||||
/// Default <see cref="string"/> is "A value for the '{0}' parameter or property was not provided.".
|
||||
/// </value>
|
||||
public virtual Func<string, string> MissingBindRequiredValueAccessor { get; }
|
||||
public virtual Func<string, string> MissingBindRequiredValueAccessor { get; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// Error message the model binding system adds when either the key or the value of a
|
||||
/// <see cref="System.Collections.Generic.KeyValuePair{TKey, TValue}"/> is bound but not both.
|
||||
/// </summary>
|
||||
/// <value>Default <see cref="string"/> is "A value is required.".</value>
|
||||
public virtual Func<string> MissingKeyOrValueAccessor { get; }
|
||||
public virtual Func<string> MissingKeyOrValueAccessor { get; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// Error message the model binding system adds when no value is provided for the request body,
|
||||
/// but a value is required.
|
||||
/// </summary>
|
||||
/// <value>Default <see cref="string"/> is "A non-empty request body is required.".</value>
|
||||
public virtual Func<string> MissingRequestBodyRequiredValueAccessor { get; }
|
||||
public virtual Func<string> MissingRequestBodyRequiredValueAccessor { get; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// Error message the model binding system adds when a <c>null</c> value is bound to a
|
||||
/// non-<see cref="Nullable"/> property.
|
||||
/// </summary>
|
||||
/// <value>Default <see cref="string"/> is "The value '{0}' is invalid.".</value>
|
||||
public virtual Func<string, string> ValueMustNotBeNullAccessor { get; }
|
||||
public virtual Func<string, string> ValueMustNotBeNullAccessor { get; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// Error message the model binding system adds when <see cref="ModelError.Exception"/> is of type
|
||||
|
|
@ -46,7 +46,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Metadata
|
|||
/// with a property.
|
||||
/// </summary>
|
||||
/// <value>Default <see cref="string"/> is "The value '{0}' is not valid for {1}.".</value>
|
||||
public virtual Func<string, string, string> AttemptedValueIsInvalidAccessor { get; }
|
||||
public virtual Func<string, string, string> AttemptedValueIsInvalidAccessor { get; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// Error message the model binding system adds when <see cref="ModelError.Exception"/> is of type
|
||||
|
|
@ -54,7 +54,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Metadata
|
|||
/// with a collection element or action parameter.
|
||||
/// </summary>
|
||||
/// <value>Default <see cref="string"/> is "The value '{0}' is not valid.".</value>
|
||||
public virtual Func<string, string> NonPropertyAttemptedValueIsInvalidAccessor { get; }
|
||||
public virtual Func<string, string> NonPropertyAttemptedValueIsInvalidAccessor { get; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// Error message the model binding system adds when <see cref="ModelError.Exception"/> is of type
|
||||
|
|
@ -62,7 +62,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Metadata
|
|||
/// with a property.
|
||||
/// </summary>
|
||||
/// <value>Default <see cref="string"/> is "The supplied value is invalid for {0}.".</value>
|
||||
public virtual Func<string, string> UnknownValueIsInvalidAccessor { get; }
|
||||
public virtual Func<string, string> UnknownValueIsInvalidAccessor { get; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// Error message the model binding system adds when <see cref="ModelError.Exception"/> is of type
|
||||
|
|
@ -70,21 +70,21 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Metadata
|
|||
/// with a collection element or action parameter.
|
||||
/// </summary>
|
||||
/// <value>Default <see cref="string"/> is "The supplied value is invalid.".</value>
|
||||
public virtual Func<string> NonPropertyUnknownValueIsInvalidAccessor { get; }
|
||||
public virtual Func<string> NonPropertyUnknownValueIsInvalidAccessor { get; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// Fallback error message HTML and tag helpers display when a property is invalid but the
|
||||
/// <see cref="ModelError"/>s have <c>null</c> <see cref="ModelError.ErrorMessage"/>s.
|
||||
/// </summary>
|
||||
/// <value>Default <see cref="string"/> is "The value '{0}' is invalid.".</value>
|
||||
public virtual Func<string, string> ValueIsInvalidAccessor { get; }
|
||||
public virtual Func<string, string> ValueIsInvalidAccessor { get; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// Error message HTML and tag helpers add for client-side validation of numeric formats. Visible in the
|
||||
/// browser if the field for a <c>float</c> (for example) property does not have a correctly-formatted value.
|
||||
/// </summary>
|
||||
/// <value>Default <see cref="string"/> is "The field {0} must be a number.".</value>
|
||||
public virtual Func<string, string> ValueMustBeANumberAccessor { get; }
|
||||
public virtual Func<string, string> ValueMustBeANumberAccessor { get; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// Error message HTML and tag helpers add for client-side validation of numeric formats. Visible in the
|
||||
|
|
@ -92,6 +92,6 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Metadata
|
|||
/// correctly-formatted value.
|
||||
/// </summary>
|
||||
/// <value>Default <see cref="string"/> is "The field must be a number.".</value>
|
||||
public virtual Func<string> NonPropertyValueMustBeANumberAccessor { get; }
|
||||
public virtual Func<string> NonPropertyValueMustBeANumberAccessor { get; } = default!;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
using System;
|
||||
using System.Reflection;
|
||||
using Microsoft.AspNetCore.Mvc.Abstractions;
|
||||
using Microsoft.Extensions.Internal;
|
||||
|
||||
namespace Microsoft.AspNetCore.Mvc.ModelBinding.Metadata
|
||||
{
|
||||
|
|
@ -15,9 +14,9 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Metadata
|
|||
{
|
||||
private ModelMetadataIdentity(
|
||||
Type modelType,
|
||||
string name = null,
|
||||
Type containerType = null,
|
||||
object fieldInfo = null)
|
||||
string? name = null,
|
||||
Type? containerType = null,
|
||||
object? fieldInfo = null)
|
||||
{
|
||||
ModelType = modelType;
|
||||
Name = name;
|
||||
|
|
@ -107,7 +106,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Metadata
|
|||
/// <param name="parameter">The <see cref="ParameterInfo" />.</param>
|
||||
/// <returns>A <see cref="ModelMetadataIdentity"/>.</returns>
|
||||
public static ModelMetadataIdentity ForParameter(ParameterInfo parameter)
|
||||
=> ForParameter(parameter, parameter?.ParameterType);
|
||||
=> ForParameter(parameter, parameter.ParameterType);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a <see cref="ModelMetadataIdentity"/> for the provided parameter with the specified
|
||||
|
|
@ -135,7 +134,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Metadata
|
|||
/// Gets the <see cref="Type"/> defining the model property represented by the current
|
||||
/// instance, or <c>null</c> if the current instance does not represent a property.
|
||||
/// </summary>
|
||||
public Type ContainerType { get; }
|
||||
public Type? ContainerType { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the <see cref="Type"/> represented by the current instance.
|
||||
|
|
@ -168,21 +167,21 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Metadata
|
|||
/// Gets the name of the current instance if it represents a parameter or property, or <c>null</c> if
|
||||
/// the current instance represents a type.
|
||||
/// </summary>
|
||||
public string Name { get; }
|
||||
public string? Name { get; }
|
||||
|
||||
private object FieldInfo { get; }
|
||||
private object? FieldInfo { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a descriptor for the parameter, or <c>null</c> if this instance
|
||||
/// does not represent a parameter.
|
||||
/// </summary>
|
||||
public ParameterInfo ParameterInfo => FieldInfo as ParameterInfo;
|
||||
public ParameterInfo? ParameterInfo => FieldInfo as ParameterInfo;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a descriptor for the property, or <c>null</c> if this instance
|
||||
/// does not represent a property.
|
||||
/// </summary>
|
||||
public PropertyInfo PropertyInfo => FieldInfo as PropertyInfo;
|
||||
public PropertyInfo? PropertyInfo => FieldInfo as PropertyInfo;
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool Equals(ModelMetadataIdentity other)
|
||||
|
|
@ -196,7 +195,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Metadata
|
|||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool Equals(object obj)
|
||||
public override bool Equals(object? obj)
|
||||
{
|
||||
var other = obj as ModelMetadataIdentity?;
|
||||
return other.HasValue && Equals(other.Value);
|
||||
|
|
@ -205,13 +204,13 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Metadata
|
|||
/// <inheritdoc />
|
||||
public override int GetHashCode()
|
||||
{
|
||||
var hash = new HashCodeCombiner();
|
||||
var hash = new HashCode();
|
||||
hash.Add(ContainerType);
|
||||
hash.Add(ModelType);
|
||||
hash.Add(Name, StringComparer.Ordinal);
|
||||
hash.Add(ParameterInfo);
|
||||
hash.Add(PropertyInfo);
|
||||
return hash;
|
||||
return hash.ToHashCode();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -48,6 +48,6 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
/// <summary>
|
||||
/// Gets the <see cref="IServiceProvider"/>.
|
||||
/// </summary>
|
||||
public virtual IServiceProvider Services { get; }
|
||||
public virtual IServiceProvider Services { get; } = default!;
|
||||
}
|
||||
}
|
||||
|
|
@ -39,7 +39,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
/// <summary>
|
||||
/// Gets the <see cref="Http.HttpContext"/> associated with this context.
|
||||
/// </summary>
|
||||
public virtual HttpContext HttpContext => ActionContext?.HttpContext;
|
||||
public virtual HttpContext HttpContext => ActionContext?.HttpContext!;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets an indication that the current binder is handling the top-level object.
|
||||
|
|
@ -71,7 +71,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
/// Gets or sets the name of the top-level model. This is not reset to <see cref="string.Empty"/> when value
|
||||
/// providers have no match for that model.
|
||||
/// </summary>
|
||||
public string OriginalModelName { get; protected set; }
|
||||
public string OriginalModelName { get; protected set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the <see cref="ModelStateDictionary"/> used to capture <see cref="ModelStateEntry"/> values
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using Microsoft.Extensions.Internal;
|
||||
|
||||
namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
||||
{
|
||||
|
|
@ -19,7 +18,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
{
|
||||
return new ModelBindingResult(model: null, isModelSet: false);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Creates a <see cref="ModelBindingResult"/> representing a successful model binding operation.
|
||||
/// </summary>
|
||||
|
|
@ -27,10 +26,10 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
/// <returns>A <see cref="ModelBindingResult"/> representing a successful model bind.</returns>
|
||||
public static ModelBindingResult Success(object model)
|
||||
{
|
||||
return new ModelBindingResult( model, isModelSet: true);
|
||||
return new ModelBindingResult(model, isModelSet: true);
|
||||
}
|
||||
|
||||
private ModelBindingResult(object model, bool isModelSet)
|
||||
private ModelBindingResult(object? model, bool isModelSet)
|
||||
{
|
||||
Model = model;
|
||||
IsModelSet = isModelSet;
|
||||
|
|
@ -39,7 +38,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
/// <summary>
|
||||
/// Gets the model associated with this context.
|
||||
/// </summary>
|
||||
public object Model { get; }
|
||||
public object? Model { get; }
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
|
|
@ -53,7 +52,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
public bool IsModelSet { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool Equals(object obj)
|
||||
public override bool Equals(object? obj)
|
||||
{
|
||||
var other = obj as ModelBindingResult?;
|
||||
if (other == null)
|
||||
|
|
@ -69,11 +68,11 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
/// <inheritdoc />
|
||||
public override int GetHashCode()
|
||||
{
|
||||
var hashCodeCombiner = HashCodeCombiner.Start();
|
||||
var hashCodeCombiner = new HashCode();
|
||||
hashCodeCombiner.Add(IsModelSet);
|
||||
hashCodeCombiner.Add(Model);
|
||||
|
||||
return hashCodeCombiner.CombinedHash;
|
||||
return hashCodeCombiner.ToHashCode();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
/// </summary>
|
||||
/// <param name="exception">The <see cref="System.Exception"/>.</param>
|
||||
/// <param name="errorMessage">The error message.</param>
|
||||
public ModelError(Exception exception, string errorMessage)
|
||||
public ModelError(Exception exception, string? errorMessage)
|
||||
: this(errorMessage)
|
||||
{
|
||||
Exception = exception ?? throw new ArgumentNullException(nameof(exception));
|
||||
|
|
@ -35,7 +35,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
/// Initializes a new instance of <see cref="ModelError"/> with the specified <paramref name="errorMessage"/>.
|
||||
/// </summary>
|
||||
/// <param name="errorMessage">The error message.</param>
|
||||
public ModelError(string errorMessage)
|
||||
public ModelError(string? errorMessage)
|
||||
{
|
||||
ErrorMessage = errorMessage ?? string.Empty;
|
||||
}
|
||||
|
|
@ -43,7 +43,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
/// <summary>
|
||||
/// Gets the <see cref="System.Exception"/> associated with this <see cref="ModelError"/> instance.
|
||||
/// </summary>
|
||||
public Exception Exception { get; }
|
||||
public Exception? Exception { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the error message associated with this <see cref="ModelError"/> instance.
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
/// A metadata representation of a model type, property or parameter.
|
||||
/// </summary>
|
||||
[DebuggerDisplay("{DebuggerToString(),nq}")]
|
||||
public abstract class ModelMetadata : IEquatable<ModelMetadata>, IModelMetadataProvider
|
||||
public abstract class ModelMetadata : IEquatable<ModelMetadata?>, IModelMetadataProvider
|
||||
{
|
||||
/// <summary>
|
||||
/// The default value of <see cref="ModelMetadata.Order"/>.
|
||||
|
|
@ -40,7 +40,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
/// <summary>
|
||||
/// Gets the type containing the property if this metadata is for a property; <see langword="null"/> otherwise.
|
||||
/// </summary>
|
||||
public Type ContainerType => Identity.ContainerType;
|
||||
public Type? ContainerType => Identity.ContainerType;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the metadata for <see cref="ContainerType"/> if this metadata is for a property;
|
||||
|
|
@ -68,17 +68,17 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
/// Gets the name of the parameter or property if this metadata is for a parameter or property;
|
||||
/// <see langword="null"/> otherwise i.e. if this is the metadata for a type.
|
||||
/// </summary>
|
||||
public string Name => Identity.Name;
|
||||
public string? Name => Identity.Name;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the name of the parameter if this metadata is for a parameter; <see langword="null"/> otherwise.
|
||||
/// </summary>
|
||||
public string ParameterName => MetadataKind == ModelMetadataKind.Parameter ? Identity.Name : null;
|
||||
public string? ParameterName => MetadataKind == ModelMetadataKind.Parameter ? Identity.Name : null;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the name of the property if this metadata is for a property; <see langword="null"/> otherwise.
|
||||
/// </summary>
|
||||
public string PropertyName => MetadataKind == ModelMetadataKind.Property ? Identity.Name : null;
|
||||
public string? PropertyName => MetadataKind == ModelMetadataKind.Property ? Identity.Name : null;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the key for the current instance.
|
||||
|
|
@ -155,7 +155,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
/// implements <see cref="IEnumerable"/> but not <see cref="IEnumerable{T}"/>. <c>null</c> otherwise i.e. when
|
||||
/// <see cref="IsEnumerableType"/> is <c>false</c>.
|
||||
/// </value>
|
||||
public abstract ModelMetadata ElementMetadata { get; }
|
||||
public abstract ModelMetadata? ElementMetadata { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the ordered and grouped display names and values of all <see cref="Enum"/> values in
|
||||
|
|
@ -318,7 +318,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
/// validated. If <c>null</c>, properties with this <see cref="ModelMetadata"/> are validated.
|
||||
/// </summary>
|
||||
/// <value>Defaults to <c>null</c>.</value>
|
||||
public virtual IPropertyValidationFilter PropertyValidationFilter => null;
|
||||
public virtual IPropertyValidationFilter? PropertyValidationFilter => null;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value that indicates whether properties or elements of the model should be validated.
|
||||
|
|
@ -343,7 +343,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
/// Gets the <see cref="Type"/> for elements of <see cref="ModelType"/> if that <see cref="Type"/>
|
||||
/// implements <see cref="IEnumerable"/>.
|
||||
/// </summary>
|
||||
public Type ElementType { get; private set; }
|
||||
public Type? ElementType { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether <see cref="ModelType"/> is a complex type.
|
||||
|
|
@ -389,7 +389,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
/// <remarks>
|
||||
/// Identical to <see cref="ModelType"/> unless <see cref="IsNullableValueType"/> is <c>true</c>.
|
||||
/// </remarks>
|
||||
public Type UnderlyingOrModelType { get; private set; }
|
||||
public Type UnderlyingOrModelType { get; private set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a property getter delegate to get the property value from a model object.
|
||||
|
|
@ -415,7 +415,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool Equals(ModelMetadata other)
|
||||
public bool Equals(ModelMetadata? other)
|
||||
{
|
||||
if (object.ReferenceEquals(this, other))
|
||||
{
|
||||
|
|
@ -433,7 +433,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool Equals(object obj)
|
||||
public override bool Equals(object? obj)
|
||||
{
|
||||
return Equals(obj as ModelMetadata);
|
||||
}
|
||||
|
|
@ -469,14 +469,14 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
else if (ModelType.IsArray)
|
||||
{
|
||||
IsEnumerableType = true;
|
||||
ElementType = ModelType.GetElementType();
|
||||
ElementType = ModelType.GetElementType()!;
|
||||
}
|
||||
else
|
||||
{
|
||||
IsEnumerableType = true;
|
||||
|
||||
var enumerableType = ClosedGenericMatcher.ExtractGenericInterface(ModelType, typeof(IEnumerable<>));
|
||||
ElementType = enumerableType?.GenericTypeArguments[0];
|
||||
ElementType = enumerableType?.GenericTypeArguments[0]!;
|
||||
|
||||
if (ElementType == null)
|
||||
{
|
||||
|
|
@ -497,7 +497,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
case ModelMetadataKind.Parameter:
|
||||
return $"ModelMetadata (Parameter: '{ParameterName}' Type: '{ModelType.Name}')";
|
||||
case ModelMetadataKind.Property:
|
||||
return $"ModelMetadata (Property: '{ContainerType.Name}.{PropertyName}' Type: '{ModelType.Name}')";
|
||||
return $"ModelMetadata (Property: '{ContainerType!.Name}.{PropertyName}' Type: '{ModelType.Name}')";
|
||||
case ModelMetadataKind.Type:
|
||||
return $"ModelMetadata (Type: '{ModelType.Name}')";
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
/// The <see cref="ModelMetadata"/> instance for the property specified by <paramref name="propertyName"/>, or
|
||||
/// <c>null</c> if no match can be found.
|
||||
/// </returns>
|
||||
public ModelMetadata this[string propertyName]
|
||||
public ModelMetadata? this[string propertyName]
|
||||
{
|
||||
get
|
||||
{
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ using System;
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Runtime.CompilerServices;
|
||||
using Microsoft.AspNetCore.Mvc.Abstractions;
|
||||
using Microsoft.AspNetCore.Mvc.Formatters;
|
||||
|
|
@ -166,7 +167,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
}
|
||||
|
||||
TryGetValue(key, out var entry);
|
||||
return entry;
|
||||
return entry!;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -305,15 +306,15 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
}
|
||||
else if (entry == null)
|
||||
{
|
||||
errorMessage = messageProvider.UnknownValueIsInvalidAccessor(name);
|
||||
errorMessage = messageProvider.UnknownValueIsInvalidAccessor(name!);
|
||||
}
|
||||
else if (name == null)
|
||||
{
|
||||
errorMessage = messageProvider.NonPropertyAttemptedValueIsInvalidAccessor(entry.AttemptedValue);
|
||||
errorMessage = messageProvider.NonPropertyAttemptedValueIsInvalidAccessor(entry.AttemptedValue!);
|
||||
}
|
||||
else
|
||||
{
|
||||
errorMessage = messageProvider.AttemptedValueIsInvalidAccessor(entry.AttemptedValue, name);
|
||||
errorMessage = messageProvider.AttemptedValueIsInvalidAccessor(entry.AttemptedValue!, name);
|
||||
}
|
||||
|
||||
return TryAddModelError(key, errorMessage);
|
||||
|
|
@ -511,7 +512,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
/// <param name="attemptedValue">
|
||||
/// The values of <paramref name="rawValue"/> in a comma-separated <see cref="string"/>.
|
||||
/// </param>
|
||||
public void SetModelValue(string key, object rawValue, string attemptedValue)
|
||||
public void SetModelValue(string key, object? rawValue, string attemptedValue)
|
||||
{
|
||||
if (key == null)
|
||||
{
|
||||
|
|
@ -540,7 +541,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
}
|
||||
|
||||
// Avoid creating a new array for rawValue if there's only one value.
|
||||
object rawValue;
|
||||
object? rawValue;
|
||||
if (valueProviderResult == ValueProviderResult.None)
|
||||
{
|
||||
rawValue = null;
|
||||
|
|
@ -573,10 +574,8 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
}
|
||||
}
|
||||
|
||||
private ModelStateNode GetNode(string key)
|
||||
private ModelStateNode? GetNode(string key)
|
||||
{
|
||||
Debug.Assert(key != null);
|
||||
|
||||
var current = _root;
|
||||
if (key.Length > 0)
|
||||
{
|
||||
|
|
@ -661,7 +660,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
return new StringSegment(key, keyStart, index - keyStart);
|
||||
}
|
||||
|
||||
private static ModelValidationState? GetValidity(ModelStateNode node)
|
||||
private static ModelValidationState? GetValidity(ModelStateNode? node)
|
||||
{
|
||||
if (node == null)
|
||||
{
|
||||
|
|
@ -774,7 +773,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool TryGetValue(string key, out ModelStateEntry value)
|
||||
public bool TryGetValue(string key, [NotNullWhen(true)] out ModelStateEntry? value)
|
||||
{
|
||||
if (key == null)
|
||||
{
|
||||
|
|
@ -893,11 +892,11 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
SubKey = subKey;
|
||||
}
|
||||
|
||||
public List<ModelStateNode> ChildNodes { get; set; }
|
||||
public List<ModelStateNode>? ChildNodes { get; set; }
|
||||
|
||||
public override IReadOnlyList<ModelStateEntry> Children => ChildNodes;
|
||||
public override IReadOnlyList<ModelStateEntry>? Children => ChildNodes;
|
||||
|
||||
public string Key { get; set; }
|
||||
public string Key { get; set; } = default!;
|
||||
|
||||
public StringSegment SubKey { get; }
|
||||
|
||||
|
|
@ -931,9 +930,9 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public ModelStateNode GetNode(StringSegment subKey)
|
||||
public ModelStateNode? GetNode(StringSegment subKey)
|
||||
{
|
||||
ModelStateNode modelStateNode = null;
|
||||
ModelStateNode? modelStateNode = null;
|
||||
if (subKey.Length == 0)
|
||||
{
|
||||
modelStateNode = this;
|
||||
|
|
@ -981,7 +980,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
return modelStateNode;
|
||||
}
|
||||
|
||||
public override ModelStateEntry GetModelStateForProperty(string propertyName)
|
||||
public override ModelStateEntry? GetModelStateForProperty(string propertyName)
|
||||
=> GetNode(new StringSegment(propertyName));
|
||||
|
||||
private int BinarySearch(StringSegment searchKey)
|
||||
|
|
@ -1068,9 +1067,9 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
/// </summary>
|
||||
public struct Enumerator : IEnumerator<KeyValuePair<string, ModelStateEntry>>
|
||||
{
|
||||
private readonly ModelStateNode _rootNode;
|
||||
private readonly ModelStateNode? _rootNode;
|
||||
private ModelStateNode _modelStateNode;
|
||||
private List<ModelStateNode> _nodes;
|
||||
private List<ModelStateNode>? _nodes;
|
||||
private int _index;
|
||||
private bool _visitedRoot;
|
||||
|
||||
|
|
@ -1093,7 +1092,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
|
||||
_index = -1;
|
||||
_rootNode = dictionary.GetNode(prefix);
|
||||
_modelStateNode = null;
|
||||
_modelStateNode = default!;
|
||||
_nodes = null;
|
||||
_visitedRoot = false;
|
||||
}
|
||||
|
|
@ -1141,7 +1140,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
while (_nodes.Count > 0)
|
||||
{
|
||||
var node = _nodes[0];
|
||||
if (_index == node.ChildNodes.Count - 1)
|
||||
if (_index == node.ChildNodes!.Count - 1)
|
||||
{
|
||||
// We've exhausted the current sublist.
|
||||
_nodes.RemoveAt(0);
|
||||
|
|
@ -1173,9 +1172,9 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
public void Reset()
|
||||
{
|
||||
_index = -1;
|
||||
_nodes.Clear();
|
||||
_nodes?.Clear();
|
||||
_visitedRoot = false;
|
||||
_modelStateNode = null;
|
||||
_modelStateNode = default!;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1218,7 +1217,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
public KeyEnumerator(ModelStateDictionary dictionary, string prefix)
|
||||
{
|
||||
_prefixEnumerator = new Enumerator(dictionary, prefix);
|
||||
Current = null;
|
||||
Current = default!;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
|
@ -1240,7 +1239,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
}
|
||||
else
|
||||
{
|
||||
Current = null;
|
||||
Current = default!;
|
||||
}
|
||||
|
||||
return result;
|
||||
|
|
@ -1250,7 +1249,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
public void Reset()
|
||||
{
|
||||
_prefixEnumerator.Reset();
|
||||
Current = null;
|
||||
Current = default!;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1293,7 +1292,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
public ValueEnumerator(ModelStateDictionary dictionary, string prefix)
|
||||
{
|
||||
_prefixEnumerator = new Enumerator(dictionary, prefix);
|
||||
Current = null;
|
||||
Current = default!;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
|
@ -1315,7 +1314,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
}
|
||||
else
|
||||
{
|
||||
Current = null;
|
||||
Current = default!;
|
||||
}
|
||||
|
||||
return result;
|
||||
|
|
@ -1325,7 +1324,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
public void Reset()
|
||||
{
|
||||
_prefixEnumerator.Reset();
|
||||
Current = null;
|
||||
Current = default!;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,17 +10,17 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
/// </summary>
|
||||
public abstract class ModelStateEntry
|
||||
{
|
||||
private ModelErrorCollection _errors;
|
||||
private ModelErrorCollection? _errors;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the raw value from the request associated with this entry.
|
||||
/// </summary>
|
||||
public object RawValue { get; set; }
|
||||
public object? RawValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the set of values contained in <see cref="RawValue"/>, joined into a comma-separated string.
|
||||
/// </summary>
|
||||
public string AttemptedValue { get; set; }
|
||||
public string? AttemptedValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the <see cref="ModelErrorCollection"/> for this entry.
|
||||
|
|
@ -61,7 +61,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
/// This method returns any existing entry, even those with <see cref="IsContainerNode"/> with value
|
||||
/// <see langword="true"/>.
|
||||
/// </remarks>
|
||||
public abstract ModelStateEntry GetModelStateForProperty(string propertyName);
|
||||
public abstract ModelStateEntry? GetModelStateForProperty(string propertyName);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the <see cref="ModelStateEntry"/> values for sub-properties.
|
||||
|
|
@ -70,6 +70,6 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
/// This property returns all existing entries, even those with <see cref="IsContainerNode"/> with value
|
||||
/// <see langword="true"/>.
|
||||
/// </remarks>
|
||||
public abstract IReadOnlyList<ModelStateEntry> Children { get; }
|
||||
public abstract IReadOnlyList<ModelStateEntry>? Children { get; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,12 +30,12 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Validation
|
|||
/// <summary>
|
||||
/// Gets the metadata associated with the <see cref="Validator"/>.
|
||||
/// </summary>
|
||||
public object ValidatorMetadata { get; }
|
||||
public object ValidatorMetadata { get; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the <see cref="IClientModelValidator"/>.
|
||||
/// </summary>
|
||||
public IClientModelValidator Validator { get; set; }
|
||||
public IClientModelValidator Validator { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether or not <see cref="Validator"/> can be reused across requests.
|
||||
|
|
|
|||
|
|
@ -10,8 +10,8 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Validation
|
|||
/// </summary>
|
||||
public struct ValidationEntry
|
||||
{
|
||||
private object _model;
|
||||
private Func<object> _modelAccessor;
|
||||
private object? _model;
|
||||
private Func<object>? _modelAccessor;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="ValidationEntry"/>.
|
||||
|
|
@ -79,7 +79,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Validation
|
|||
/// <summary>
|
||||
/// The model object.
|
||||
/// </summary>
|
||||
public object Model
|
||||
public object? Model
|
||||
{
|
||||
get
|
||||
{
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace Microsoft.AspNetCore.Mvc.ModelBinding.Validation
|
||||
{
|
||||
|
|
@ -25,8 +25,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Validation
|
|||
_inner = new Dictionary<object, ValidationStateEntry>(ReferenceEqualityComparer.Instance);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public ValidationStateEntry this[object key]
|
||||
public ValidationStateEntry? this[object key]
|
||||
{
|
||||
get
|
||||
{
|
||||
|
|
@ -36,10 +35,19 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Validation
|
|||
|
||||
set
|
||||
{
|
||||
_inner[key] = value;
|
||||
_inner[key] = value!;
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
ValidationStateEntry IDictionary<object, ValidationStateEntry>.this[object key]
|
||||
{
|
||||
get => this[key]!;
|
||||
set => this[key] = value;
|
||||
}
|
||||
|
||||
ValidationStateEntry IReadOnlyDictionary<object, ValidationStateEntry>.this[object key] => this[key]!;
|
||||
|
||||
/// <inheritdoc />
|
||||
public int Count => _inner.Count;
|
||||
|
||||
|
|
@ -115,7 +123,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Validation
|
|||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool TryGetValue(object key, out ValidationStateEntry value)
|
||||
public bool TryGetValue(object key, [MaybeNullWhen(false)] out ValidationStateEntry value)
|
||||
{
|
||||
return _inner.TryGetValue(key, out value);
|
||||
}
|
||||
|
|
@ -125,30 +133,5 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Validation
|
|||
{
|
||||
return ((IDictionary<object, ValidationStateEntry>)_inner).GetEnumerator();
|
||||
}
|
||||
|
||||
private class ReferenceEqualityComparer : IEqualityComparer<object>
|
||||
{
|
||||
private static readonly bool IsMono = Type.GetType("Mono.Runtime") != null;
|
||||
|
||||
public static readonly ReferenceEqualityComparer Instance = new ReferenceEqualityComparer();
|
||||
|
||||
public new bool Equals(object x, object y)
|
||||
{
|
||||
return Object.ReferenceEquals(x, y);
|
||||
}
|
||||
|
||||
public int GetHashCode(object obj)
|
||||
{
|
||||
// RuntimeHelpers.GetHashCode sometimes crashes the runtime on Mono 4.0.4
|
||||
// See: https://github.com/aspnet/External/issues/45
|
||||
// The workaround here is to just not hash anything, and fall back to an equality check.
|
||||
if (IsMono)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
return RuntimeHelpers.GetHashCode(obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -12,12 +12,12 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Validation
|
|||
/// <summary>
|
||||
/// Gets or sets the model prefix associated with the entry.
|
||||
/// </summary>
|
||||
public string Key { get; set; }
|
||||
public string Key { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the <see cref="ModelMetadata"/> associated with the entry.
|
||||
/// </summary>
|
||||
public ModelMetadata Metadata { get; set; }
|
||||
public ModelMetadata Metadata { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the associated model object should be validated.
|
||||
|
|
@ -28,6 +28,6 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Validation
|
|||
/// Gets or sets an <see cref="IValidationStrategy"/> for enumerating child entries of the associated
|
||||
/// model object.
|
||||
/// </summary>
|
||||
public IValidationStrategy Strategy { get; set; }
|
||||
public IValidationStrategy Strategy { get; set; } = default!;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,12 +30,12 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Validation
|
|||
/// <summary>
|
||||
/// Gets the metadata associated with the <see cref="Validator"/>.
|
||||
/// </summary>
|
||||
public object ValidatorMetadata { get; }
|
||||
public object ValidatorMetadata { get; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the <see cref="IModelValidator"/>.
|
||||
/// </summary>
|
||||
public IModelValidator Validator { get; set; }
|
||||
public IModelValidator Validator { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether or not <see cref="Validator"/> can be reused across requests.
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
/// to get a single value for processing regardless of whether a single or multiple values were provided
|
||||
/// in the request.
|
||||
/// </summary>
|
||||
public string FirstValue
|
||||
public string? FirstValue
|
||||
{
|
||||
get
|
||||
{
|
||||
|
|
@ -87,7 +87,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
public int Length => Values.Count;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool Equals(object obj)
|
||||
public override bool Equals(object? obj)
|
||||
{
|
||||
var other = obj as ValueProviderResult?;
|
||||
return other.HasValue && Equals(other.Value);
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ namespace Microsoft.AspNetCore.Mvc.Routing
|
|||
/// <summary>
|
||||
/// The route template. May be null if the action has no attribute routes.
|
||||
/// </summary>
|
||||
public string Template { get; set; }
|
||||
public string? Template { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the order of the route associated with a given action. This property determines
|
||||
|
|
@ -27,7 +27,7 @@ namespace Microsoft.AspNetCore.Mvc.Routing
|
|||
/// to generate a link by referring to the route by name instead of attempting to match a
|
||||
/// route by provided route data.
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
public string Name { get; set; } = default!;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value that determines if the route entry associated with this model participates in link generation.
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ namespace Microsoft.AspNetCore.Mvc.Routing
|
|||
/// <summary>
|
||||
/// The name of the action method that <see cref="IUrlHelper.Action(UrlActionContext)"/> uses to generate URLs.
|
||||
/// </summary>
|
||||
public string Action
|
||||
public string? Action
|
||||
{
|
||||
get;
|
||||
set;
|
||||
|
|
@ -20,7 +20,7 @@ namespace Microsoft.AspNetCore.Mvc.Routing
|
|||
/// <summary>
|
||||
/// The name of the controller that <see cref="IUrlHelper.Action(UrlActionContext)"/> uses to generate URLs.
|
||||
/// </summary>
|
||||
public string Controller
|
||||
public string? Controller
|
||||
{
|
||||
get;
|
||||
set;
|
||||
|
|
@ -30,7 +30,7 @@ namespace Microsoft.AspNetCore.Mvc.Routing
|
|||
/// The object that contains the route values that <see cref="IUrlHelper.Action(UrlActionContext)"/>
|
||||
/// uses to generate URLs.
|
||||
/// </summary>
|
||||
public object Values
|
||||
public object? Values
|
||||
{
|
||||
get;
|
||||
set;
|
||||
|
|
@ -40,7 +40,7 @@ namespace Microsoft.AspNetCore.Mvc.Routing
|
|||
/// The protocol for the URLs that <see cref="IUrlHelper.Action(UrlActionContext)"/> generates,
|
||||
/// such as "http" or "https"
|
||||
/// </summary>
|
||||
public string Protocol
|
||||
public string? Protocol
|
||||
{
|
||||
get;
|
||||
set;
|
||||
|
|
@ -49,7 +49,7 @@ namespace Microsoft.AspNetCore.Mvc.Routing
|
|||
/// <summary>
|
||||
/// The host name for the URLs that <see cref="IUrlHelper.Action(UrlActionContext)"/> generates.
|
||||
/// </summary>
|
||||
public string Host
|
||||
public string? Host
|
||||
{
|
||||
get;
|
||||
set;
|
||||
|
|
@ -58,7 +58,7 @@ namespace Microsoft.AspNetCore.Mvc.Routing
|
|||
/// <summary>
|
||||
/// The fragment for the URLs that <see cref="IUrlHelper.Action(UrlActionContext)"/> generates.
|
||||
/// </summary>
|
||||
public string Fragment
|
||||
public string? Fragment
|
||||
{
|
||||
get;
|
||||
set;
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ namespace Microsoft.AspNetCore.Mvc.Routing
|
|||
/// <summary>
|
||||
/// The name of the route that <see cref="IUrlHelper.RouteUrl(UrlRouteContext)"/> uses to generate URLs.
|
||||
/// </summary>
|
||||
public string RouteName
|
||||
public string? RouteName
|
||||
{
|
||||
get;
|
||||
set;
|
||||
|
|
@ -21,7 +21,7 @@ namespace Microsoft.AspNetCore.Mvc.Routing
|
|||
/// The object that contains the route values that <see cref="IUrlHelper.RouteUrl(UrlRouteContext)"/>
|
||||
/// uses to generate URLs.
|
||||
/// </summary>
|
||||
public object Values
|
||||
public object? Values
|
||||
{
|
||||
get;
|
||||
set;
|
||||
|
|
@ -31,7 +31,7 @@ namespace Microsoft.AspNetCore.Mvc.Routing
|
|||
/// The protocol for the URLs that <see cref="IUrlHelper.RouteUrl(UrlRouteContext)"/> generates,
|
||||
/// such as "http" or "https"
|
||||
/// </summary>
|
||||
public string Protocol
|
||||
public string? Protocol
|
||||
{
|
||||
get;
|
||||
set;
|
||||
|
|
@ -40,7 +40,7 @@ namespace Microsoft.AspNetCore.Mvc.Routing
|
|||
/// <summary>
|
||||
/// The host name for the URLs that <see cref="IUrlHelper.RouteUrl(UrlRouteContext)"/> generates.
|
||||
/// </summary>
|
||||
public string Host
|
||||
public string? Host
|
||||
{
|
||||
get;
|
||||
set;
|
||||
|
|
@ -49,7 +49,7 @@ namespace Microsoft.AspNetCore.Mvc.Routing
|
|||
/// <summary>
|
||||
/// The fragment for the URLs that <see cref="IUrlHelper.RouteUrl(UrlRouteContext)"/> generates.
|
||||
/// </summary>
|
||||
public string Fragment
|
||||
public string? Fragment
|
||||
{
|
||||
get;
|
||||
set;
|
||||
|
|
|
|||
|
|
@ -662,11 +662,11 @@ namespace Microsoft.AspNetCore.Mvc.ApiExplorer
|
|||
|
||||
public int GetHashCode(PropertyKey obj)
|
||||
{
|
||||
var hashCodeCombiner = HashCodeCombiner.Start();
|
||||
var hashCodeCombiner = new HashCode();
|
||||
hashCodeCombiner.Add(obj.ContainerType);
|
||||
hashCodeCombiner.Add(obj.PropertyName);
|
||||
hashCodeCombiner.Add(obj.Source);
|
||||
return hashCodeCombiner.CombinedHash;
|
||||
return hashCodeCombiner.ToHashCode();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -319,10 +319,10 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
var hash = new HashCodeCombiner();
|
||||
var hash = new HashCode();
|
||||
hash.Add(_metadata);
|
||||
hash.Add(RuntimeHelpers.GetHashCode(_token));
|
||||
return hash;
|
||||
return hash.ToHashCode();
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
|
|
|
|||
|
|
@ -291,10 +291,10 @@ namespace Microsoft.AspNetCore.Mvc.Routing
|
|||
return 0;
|
||||
}
|
||||
|
||||
var hash = new HashCodeCombiner();
|
||||
var hash = new HashCode();
|
||||
hash.Add(obj.Order);
|
||||
hash.Add(obj.RouteTemplate.TemplateText, StringComparer.OrdinalIgnoreCase);
|
||||
return hash;
|
||||
return hash.ToHashCode();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -123,14 +123,14 @@ namespace Microsoft.AspNetCore.Mvc.Razor
|
|||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
var hashCodeCombiner = HashCodeCombiner.Start();
|
||||
var hashCodeCombiner = new HashCode();
|
||||
hashCodeCombiner.Add(PageType);
|
||||
if (ProvidedModelType != null)
|
||||
{
|
||||
hashCodeCombiner.Add(ProvidedModelType);
|
||||
}
|
||||
|
||||
return hashCodeCombiner.CombinedHash;
|
||||
return hashCodeCombiner.ToHashCode();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor
|
|||
/// <inheritdoc />
|
||||
public override int GetHashCode()
|
||||
{
|
||||
var hashCodeCombiner = HashCodeCombiner.Start();
|
||||
var hashCodeCombiner = new HashCode();
|
||||
hashCodeCombiner.Add(IsMainPage ? 1 : 0);
|
||||
hashCodeCombiner.Add(ViewName, StringComparer.Ordinal);
|
||||
hashCodeCombiner.Add(ControllerName, StringComparer.Ordinal);
|
||||
|
|
@ -151,7 +151,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor
|
|||
}
|
||||
}
|
||||
|
||||
return hashCodeCombiner;
|
||||
return hashCodeCombiner.ToHashCode();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -247,7 +247,7 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers.Cache
|
|||
return _hashcode.Value;
|
||||
}
|
||||
|
||||
var hashCodeCombiner = new HashCodeCombiner();
|
||||
var hashCodeCombiner = new HashCode();
|
||||
|
||||
hashCodeCombiner.Add(Key, StringComparer.Ordinal);
|
||||
hashCodeCombiner.Add(_expiresAfter);
|
||||
|
|
@ -258,12 +258,12 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers.Cache
|
|||
hashCodeCombiner.Add(_requestCulture);
|
||||
hashCodeCombiner.Add(_requestUICulture);
|
||||
|
||||
CombineCollectionHashCode(hashCodeCombiner, VaryByCookieName, _cookies);
|
||||
CombineCollectionHashCode(hashCodeCombiner, VaryByHeaderName, _headers);
|
||||
CombineCollectionHashCode(hashCodeCombiner, VaryByQueryName, _queries);
|
||||
CombineCollectionHashCode(hashCodeCombiner, VaryByRouteName, _routeValues);
|
||||
CombineCollectionHashCode(ref hashCodeCombiner, VaryByCookieName, _cookies);
|
||||
CombineCollectionHashCode(ref hashCodeCombiner, VaryByHeaderName, _headers);
|
||||
CombineCollectionHashCode(ref hashCodeCombiner, VaryByQueryName, _queries);
|
||||
CombineCollectionHashCode(ref hashCodeCombiner, VaryByRouteName, _routeValues);
|
||||
|
||||
_hashcode = hashCodeCombiner.CombinedHash;
|
||||
_hashcode = hashCodeCombiner.ToHashCode();
|
||||
|
||||
return _hashcode.Value;
|
||||
}
|
||||
|
|
@ -331,7 +331,7 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers.Cache
|
|||
}
|
||||
|
||||
private static void CombineCollectionHashCode(
|
||||
HashCodeCombiner hashCodeCombiner,
|
||||
ref HashCode hashCodeCombiner,
|
||||
string collectionName,
|
||||
IList<KeyValuePair<string, string>> values)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Security.Policy;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.Extensions.Caching.Memory;
|
||||
using Microsoft.Extensions.FileProviders;
|
||||
|
|
@ -373,11 +374,11 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers
|
|||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
var hashCodeCombiner = HashCodeCombiner.Start();
|
||||
var hashCodeCombiner = new HashCode();
|
||||
hashCodeCombiner.Add(Include);
|
||||
hashCodeCombiner.Add(Exclude);
|
||||
|
||||
return hashCodeCombiner.CombinedHash;
|
||||
return hashCodeCombiner.ToHashCode();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ namespace Microsoft.AspNetCore.Mvc.ViewFeatures
|
|||
public int GetHashCode(LambdaExpression lambdaExpression)
|
||||
{
|
||||
var expression = lambdaExpression.Body;
|
||||
var hashCodeCombiner = HashCodeCombiner.Start();
|
||||
var hashCodeCombiner = new HashCode();
|
||||
|
||||
while (true)
|
||||
{
|
||||
|
|
@ -107,7 +107,7 @@ namespace Microsoft.AspNetCore.Mvc.ViewFeatures
|
|||
}
|
||||
}
|
||||
|
||||
return hashCodeCombiner.CombinedHash;
|
||||
return hashCodeCombiner.ToHashCode();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.Extensions.Internal;
|
||||
|
||||
|
|
@ -39,7 +40,7 @@ namespace Microsoft.AspNetCore.Mvc.ViewFeatures
|
|||
|
||||
public int GetHashCode(MemberExpressionCacheKey obj)
|
||||
{
|
||||
var hashCodeCombiner = new HashCodeCombiner();
|
||||
var hashCodeCombiner = new HashCode();
|
||||
hashCodeCombiner.Add(obj.ModelType);
|
||||
|
||||
foreach (var member in obj)
|
||||
|
|
@ -47,7 +48,7 @@ namespace Microsoft.AspNetCore.Mvc.ViewFeatures
|
|||
hashCodeCombiner.Add(member);
|
||||
}
|
||||
|
||||
return hashCodeCombiner.CombinedHash;
|
||||
return hashCodeCombiner.ToHashCode();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
#nullable enable
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Microsoft.Extensions.Internal
|
||||
|
|
@ -28,7 +29,7 @@ namespace Microsoft.Extensions.Internal
|
|||
/// <c>typeof(KeyValuePair{,})</c>, and <paramref name="queryType"/> is
|
||||
/// <c>typeof(KeyValuePair{string, object})</c>.
|
||||
/// </remarks>
|
||||
public static Type ExtractGenericInterface(Type queryType, Type interfaceType)
|
||||
public static Type? ExtractGenericInterface(Type queryType, Type interfaceType)
|
||||
{
|
||||
if (queryType == null)
|
||||
{
|
||||
|
|
@ -62,9 +63,9 @@ namespace Microsoft.Extensions.Internal
|
|||
candidate.GetGenericTypeDefinition() == interfaceType;
|
||||
}
|
||||
|
||||
private static Type GetGenericInstantiation(Type queryType, Type interfaceType)
|
||||
private static Type? GetGenericInstantiation(Type queryType, Type interfaceType)
|
||||
{
|
||||
Type bestMatch = null;
|
||||
Type? bestMatch = null;
|
||||
var interfaces = queryType.GetInterfaces();
|
||||
foreach (var @interface in interfaces)
|
||||
{
|
||||
|
|
@ -103,4 +104,4 @@ namespace Microsoft.Extensions.Internal
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue