You've already forked linux-packaging-mono
33 lines
1.1 KiB
C#
33 lines
1.1 KiB
C#
// Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information.
|
|
|
|
using System.Web.Helpers;
|
|
|
|
namespace System.Web.Mvc
|
|
{
|
|
public sealed class FormValueProviderFactory : ValueProviderFactory
|
|
{
|
|
private readonly UnvalidatedRequestValuesAccessor _unvalidatedValuesAccessor;
|
|
|
|
public FormValueProviderFactory()
|
|
: this(null)
|
|
{
|
|
}
|
|
|
|
// For unit testing
|
|
internal FormValueProviderFactory(UnvalidatedRequestValuesAccessor unvalidatedValuesAccessor)
|
|
{
|
|
_unvalidatedValuesAccessor = unvalidatedValuesAccessor ?? (cc => new UnvalidatedRequestValuesWrapper(cc.HttpContext.Request.Unvalidated()));
|
|
}
|
|
|
|
public override IValueProvider GetValueProvider(ControllerContext controllerContext)
|
|
{
|
|
if (controllerContext == null)
|
|
{
|
|
throw new ArgumentNullException("controllerContext");
|
|
}
|
|
|
|
return new FormValueProvider(controllerContext, _unvalidatedValuesAccessor(controllerContext));
|
|
}
|
|
}
|
|
}
|