// 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 Microsoft.AspNet.Http; using Microsoft.Framework.Internal; namespace Microsoft.AspNet.Localization { /// /// Determines the culture information for a request via the configured delegate. /// public class CustomRequestCultureStrategy : IRequestCultureStrategy { private readonly Func _strategy; /// /// Creates a new using the specified delegate. /// /// The strategy delegate. public CustomRequestCultureStrategy([NotNull] Func strategy) { _strategy = strategy; } /// public RequestCulture DetermineRequestCulture([NotNull] HttpContext httpContext) { return _strategy(httpContext); } } }