using System;
using EmbedIO.Utilities;
using Swan;
namespace EmbedIO
{
///
/// Provides extension methods for types implementing .
///
public static partial class HttpContextExtensions
{
///
/// Gets the underlying interface of an .
/// This API mainly supports the EmbedIO infrastructure; it is not intended to be used directly from your code,
/// unless to fulfill very specific needs in the development of plug-ins (modules, etc.) for EmbedIO.
///
/// The interface on which this method is called.
/// The underlying interface representing
/// the HTTP context implementation.
///
/// is .
///
///
/// does not implement .
///
public static IHttpContextImpl GetImplementation(this IHttpContext @this)
=> Validate.NotNull(nameof(@this), @this) as IHttpContextImpl
?? throw SelfCheck.Failure($"{@this.GetType().FullName} does not implement {nameof(IHttpContextImpl)}.");
}
}