Move ModelBindingHelper to Internal (#4664)

This commit is contained in:
Ryan Brandenburg 2016-05-18 16:52:43 -07:00
parent 78be3ad135
commit 941da9264b
12 changed files with 17 additions and 6 deletions

View File

@ -12,6 +12,7 @@ using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Authentication;
using Microsoft.AspNetCore.Mvc.Core;
using Microsoft.AspNetCore.Mvc.ModelBinding;
using Microsoft.AspNetCore.Mvc.ModelBinding.Internal;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
using Microsoft.AspNetCore.Mvc.Routing;
using Microsoft.AspNetCore.Routing;

View File

@ -11,6 +11,7 @@ using System.Linq.Expressions;
using System.Reflection;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc.Internal;
using Microsoft.AspNetCore.Mvc.ModelBinding.Internal;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
namespace Microsoft.AspNetCore.Mvc.ModelBinding.Binders
@ -169,7 +170,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Binders
ValueProviderResult values)
{
var boundCollection = new List<TElement>();
var elementMetadata = bindingContext.ModelMetadata.ElementMetadata;
foreach (var value in values)

View File

@ -10,6 +10,7 @@ using System.Reflection;
#endif
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc.Internal;
using Microsoft.AspNetCore.Mvc.ModelBinding.Internal;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
namespace Microsoft.AspNetCore.Mvc.ModelBinding.Binders

View File

@ -11,6 +11,7 @@ using System.Reflection;
#endif
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc.ModelBinding.Internal;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
namespace Microsoft.AspNetCore.Mvc.ModelBinding.Binders
@ -28,7 +29,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Binders
throw new ArgumentNullException(nameof(bindingContext));
}
var createFileCollection =
var createFileCollection =
bindingContext.ModelType == typeof(IFormFileCollection) &&
!bindingContext.ModelMetadata.IsReadOnly;
if (!createFileCollection && !ModelBindingHelper.CanGetCompatibleCollection<IFormFile>(bindingContext))

View File

@ -8,6 +8,7 @@ using System.Reflection;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc.Internal;
using Microsoft.AspNetCore.Mvc.ModelBinding.Internal;
namespace Microsoft.AspNetCore.Mvc.ModelBinding.Binders
{

View File

@ -4,6 +4,7 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc.ModelBinding.Internal;
namespace Microsoft.AspNetCore.Mvc.ModelBinding.Binders
{

View File

@ -5,6 +5,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using Microsoft.AspNetCore.Mvc.ModelBinding.Internal;
namespace Microsoft.AspNetCore.Mvc.ModelBinding
{

View File

@ -14,7 +14,7 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc.Core;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
namespace Microsoft.AspNetCore.Mvc.ModelBinding
namespace Microsoft.AspNetCore.Mvc.ModelBinding.Internal
{
public static class ModelBindingHelper
{
@ -426,7 +426,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
modelMetadata,
bindingInfo: null,
modelName: prefix ?? string.Empty);
modelBindingContext.Model = model;
modelBindingContext.PropertyFilter = propertyFilter;

View File

@ -2,6 +2,7 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using Microsoft.AspNetCore.Mvc.ModelBinding.Internal;
namespace Microsoft.AspNetCore.Mvc.ModelBinding
{

View File

@ -13,6 +13,7 @@ using Microsoft.AspNetCore.Antiforgery;
using Microsoft.AspNetCore.Html;
using Microsoft.AspNetCore.Mvc.Internal;
using Microsoft.AspNetCore.Mvc.ModelBinding;
using Microsoft.AspNetCore.Mvc.ModelBinding.Internal;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.AspNetCore.Mvc.Routing;
@ -1441,8 +1442,8 @@ namespace Microsoft.AspNetCore.Mvc.ViewFeatures
}
private IHtmlContent GenerateGroupsAndOptions(
string optionLabel,
IEnumerable<SelectListItem> selectList,
string optionLabel,
IEnumerable<SelectListItem> selectList,
ICollection<string> currentValues)
{
var listItemBuilder = new HtmlContentBuilder();

View File

@ -14,6 +14,7 @@ using Microsoft.AspNetCore.Mvc.DataAnnotations.Internal;
using Microsoft.AspNetCore.Mvc.Formatters;
using Microsoft.AspNetCore.Mvc.Internal;
using Microsoft.AspNetCore.Mvc.ModelBinding.Binders;
using Microsoft.AspNetCore.Mvc.ModelBinding.Internal;
using Microsoft.AspNetCore.Mvc.ModelBinding.Test;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
using Moq;

View File

@ -9,6 +9,7 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Internal;
using Microsoft.AspNetCore.Mvc.ModelBinding;
using Microsoft.AspNetCore.Mvc.ModelBinding.Internal;
using Microsoft.Extensions.Primitives;
using Xunit;