using MediaBrowser.Model.Services;
using Microsoft.AspNetCore.Http;
namespace MediaBrowser.Common.Extensions
{
///
/// Static class containing extension methods for .
///
public static class HttpContextExtensions
{
private const string ServiceStackRequest = "ServiceStackRequest";
///
/// Set the ServiceStack request.
///
/// The HttpContext instance.
/// The service stack request instance.
public static void SetServiceStackRequest(this HttpContext httpContext, IRequest request)
{
httpContext.Items[ServiceStackRequest] = request;
}
///
/// Get the ServiceStack request.
///
/// The HttpContext instance.
/// The service stack request instance.
public static IRequest GetServiceStackRequest(this HttpContext httpContext)
{
return (IRequest)httpContext.Items[ServiceStackRequest];
}
}
}