• Share
    • Twitter
    • LinkedIn
    • Facebook
    • Email
  • Feedback
  • Improve this Doc

Class HttpContextSource

A unit testable alternative to HttpContext.Current.

Inheritance
System.Object
HttpContextSource
Namespace: DotNetNuke.Common
Assembly: DotNetNuke.dll
Syntax
public class HttpContextSource : object

Properties

| Improve this Doc View Source

Current

Gets the current HttpContext.

Declaration
public static HttpContextBase Current { get; }
Property Value
Type Description
HttpContextBase

Methods

| Improve this Doc View Source

RegisterInstance(HttpContextBase)

Injects a fake/mock context for unit testing.

Declaration
public static void RegisterInstance(HttpContextBase instance)
Parameters
Type Name Description
HttpContextBase instance

The fake context to inject.

Extension Methods

JsonExtensionsWeb.ToJson(Object)
  • View Source
Back to top by the community, for the community... #DNNCMS