adds notes, changes to protected
This commit is contained in:
@@ -17,9 +17,27 @@ namespace Umbraco.Web.Mvc
|
||||
/// Returns the UmbracoContext for this route handler
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// By default this uses the UmbracoContext singleton
|
||||
/// By default this uses the UmbracoContext singleton, this could be overridden to check for null in the case
|
||||
/// that this handler is used for a request where an UmbracoContext is not created by default see http://issues.umbraco.org/issue/U4-9384
|
||||
/// <example>
|
||||
/// <![CDATA[
|
||||
/// protected override UmbracoContext GetUmbracoContext(RequestContext requestContext)
|
||||
/// {
|
||||
/// var ctx = base.GetUmbracoContext(requestContext);
|
||||
/// //check if context is null, we know it will be null if we are dealing with a request that
|
||||
/// //has an extension and by default no Umb ctx is created for the request
|
||||
/// if (ctx == null) {
|
||||
/// //TODO: Here you can EnsureContext , please note that the requestContext is passed in
|
||||
/// //therefore your should refrain from using other singletons like HttpContext.Current since
|
||||
/// //you will already have a reference to it. Also if you need an ApplicationContext you should
|
||||
/// //pass this in via a ctor instead of using the ApplicationContext.Current singleton.
|
||||
/// }
|
||||
/// return ctx;
|
||||
/// }
|
||||
/// ]]>
|
||||
/// </example>
|
||||
/// </remarks>
|
||||
public virtual UmbracoContext GetUmbracoContext(RequestContext requestContext)
|
||||
protected virtual UmbracoContext GetUmbracoContext(RequestContext requestContext)
|
||||
{
|
||||
return UmbracoContext.Current;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user