// 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.Threading.Tasks;
using Microsoft.AspNet.Http;
using Microsoft.Framework.Internal;
namespace Microsoft.AspNet.Localization
{
///
/// Determines the culture information for a request via the configured delegate.
///
public class CustomRequestCultureProvider : RequestCultureProvider
{
private readonly Func> _provider;
///
/// Creates a new using the specified delegate.
///
/// The provider delegate.
public CustomRequestCultureProvider([NotNull] Func> provider)
{
_provider = provider;
}
///
public override Task DetermineRequestCulture([NotNull] HttpContext httpContext)
{
return _provider(httpContext);
}
}
}