// 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.Globalization;
using System.Threading.Tasks;
namespace Microsoft.AspNet.Mvc.ModelBinding
{
///
/// A that creates instances that
/// read values from the request query-string.
///
public class QueryStringValueProviderFactory : IValueProviderFactory
{
///
public Task GetValueProviderAsync(ActionContext context)
{
if (context == null)
{
throw new ArgumentNullException(nameof(context));
}
return Task.FromResult(new QueryStringValueProvider(
BindingSource.Query,
context.HttpContext.Request.Query,
CultureInfo.InvariantCulture));
}
}
}