Skip to content

Commit 7c48769

Browse files
committed
PR feedback
1 parent 6721924 commit 7c48769

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

src/Mvc/Mvc.Abstractions/ref/Microsoft.AspNetCore.Mvc.Abstractions.netcoreapp.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ protected ModelMetadata(Microsoft.AspNetCore.Mvc.ModelBinding.Metadata.ModelMeta
642642
public abstract System.Type BinderType { get; }
643643
public abstract Microsoft.AspNetCore.Mvc.ModelBinding.BindingSource BindingSource { get; }
644644
public virtual Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata? BoundConstructor { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } }
645-
public abstract System.Func<object[], object> ConstructorInvoker { get; }
645+
public virtual System.Func<object[], object>? ConstructorInvoker { get { throw null; } }
646646
public virtual Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata ContainerMetadata { get { throw null; } }
647647
public System.Type? ContainerType { get { throw null; } }
648648
public abstract bool ConvertEmptyStringToNull { get; }

src/Mvc/Mvc.Abstractions/src/ModelBinding/Metadata/ModelBindingMessageProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public abstract class ModelBindingMessageProvider
6767
/// <summary>
6868
/// Error message the model binding system adds when <see cref="ModelError.Exception"/> is of type
6969
/// <see cref="FormatException"/> or <see cref="OverflowException"/>, value is unknown, and error is associated
70-
/// with a collection element .
70+
/// with a collection element.
7171
/// </summary>
7272
/// <value>Default <see cref="string"/> is "The supplied value is invalid.".</value>
7373
public virtual Func<string> NonPropertyUnknownValueIsInvalidAccessor { get; } = default!;

src/Mvc/Mvc.Abstractions/src/ModelBinding/ModelMetadata.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ internal IReadOnlyDictionary<ModelMetadata, ModelMetadata> ParameterMapping
498498
/// <summary>
499499
/// Gets a delegate that invokes the constructor.
500500
/// </summary>
501-
public abstract Func<object[], object> ConstructorInvoker { get; }
501+
public virtual Func<object[], object>? ConstructorInvoker => null;
502502

503503
/// <summary>
504504
/// Gets a display name for the model.

src/Mvc/Mvc.Core/src/ModelBinding/Binders/ComplexObjectModelBinder.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ internal static bool CreateModel(ModelBindingContext bindingContext, ModelMetada
230230
}
231231
}
232232

233-
var result = await BindParameter(bindingContext, parameter, parameterBinder, fieldName, modelName);
233+
var result = await BindParameterAsync(bindingContext, parameter, parameterBinder, fieldName, modelName);
234234

235235
if (result.IsModelSet)
236236
{
@@ -262,7 +262,7 @@ internal static bool CreateModel(ModelBindingContext bindingContext, ModelMetada
262262
var fieldName = parameter.BinderModelName ?? parameter.ParameterName;
263263
var modelName = ModelNames.CreatePropertyModelName(bindingContext.ModelName, fieldName);
264264

265-
var result = await BindParameter(bindingContext, parameter, parameterBinder, fieldName, modelName);
265+
var result = await BindParameterAsync(bindingContext, parameter, parameterBinder, fieldName, modelName);
266266

267267
if (result.IsModelSet)
268268
{
@@ -325,7 +325,7 @@ internal static bool CreateModel(ModelBindingContext bindingContext, ModelMetada
325325
}
326326
}
327327

328-
var result = await BindProperty(bindingContext, property, propertyBinder, fieldName, modelName);
328+
var result = await BindPropertyAsync(bindingContext, property, propertyBinder, fieldName, modelName);
329329

330330
if (result.IsModelSet)
331331
{
@@ -355,7 +355,7 @@ internal static bool CreateModel(ModelBindingContext bindingContext, ModelMetada
355355
var fieldName = property.BinderModelName ?? property.PropertyName;
356356
var modelName = ModelNames.CreatePropertyModelName(bindingContext.ModelName, fieldName);
357357

358-
await BindProperty(bindingContext, property, propertyBinder, fieldName, modelName);
358+
await BindPropertyAsync(bindingContext, property, propertyBinder, fieldName, modelName);
359359
}
360360
}
361361
}
@@ -390,7 +390,7 @@ internal bool CanBindItem(ModelBindingContext bindingContext, ModelMetadata prop
390390
return true;
391391
}
392392

393-
private async Task<ModelBindingResult> BindProperty(
393+
private async ValueTask<ModelBindingResult> BindPropertyAsync(
394394
ModelBindingContext bindingContext,
395395
ModelMetadata property,
396396
IModelBinder propertyBinder,
@@ -435,7 +435,7 @@ private async Task<ModelBindingResult> BindProperty(
435435
return result;
436436
}
437437

438-
private async Task<ModelBindingResult> BindParameter(
438+
private async ValueTask<ModelBindingResult> BindParameterAsync(
439439
ModelBindingContext bindingContext,
440440
ModelMetadata parameter,
441441
IModelBinder parameterBinder,
@@ -717,7 +717,7 @@ private static void AddModelError(
717717
}
718718
}
719719

720-
public static class Log
720+
private static class Log
721721
{
722722
private static readonly Action<ILogger, string, Type, Exception> _noPublicSettableProperties = LoggerMessage.Define<string, Type>(
723723
LogLevel.Debug,

0 commit comments

Comments
 (0)