using Umbraco.Core.Cache;
using Umbraco.Core.Models.PublishedContent;
namespace Umbraco.Web.Models.PublishedContent
{
///
/// Implements on top of .
///
public class HttpContextVariationContextAccessor : IVariationContextAccessor
{
private readonly IRequestCache _requestCache;
private const string _contextKey = "Umbraco.Web.Models.PublishedContent.DefaultVariationContextAccessor";
///
/// Initializes a new instance of the class.
///
public HttpContextVariationContextAccessor(IRequestCache requestCache)
{
_requestCache = requestCache;
}
///
public VariationContext VariationContext
{
get => (VariationContext) _requestCache.Get(_contextKey);
set => _requestCache.Set(_contextKey, value);
}
}
}