Fixes: #U4-1357 - more properties to expose context objects on SurfaceController and RenderMvcController base classes.
This commit is contained in:
@@ -2,6 +2,7 @@ using System;
|
|||||||
using System.Collections.Concurrent;
|
using System.Collections.Concurrent;
|
||||||
using System.Web.Mvc;
|
using System.Web.Mvc;
|
||||||
using Umbraco.Core;
|
using Umbraco.Core;
|
||||||
|
using Umbraco.Core.Services;
|
||||||
|
|
||||||
namespace Umbraco.Web.Mvc
|
namespace Umbraco.Web.Mvc
|
||||||
{
|
{
|
||||||
@@ -51,6 +52,22 @@ namespace Umbraco.Web.Mvc
|
|||||||
get { return UmbracoContext.Application; }
|
get { return UmbracoContext.Application; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a ServiceContext
|
||||||
|
/// </summary>
|
||||||
|
public ServiceContext Services
|
||||||
|
{
|
||||||
|
get { return ApplicationContext.Services; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a DatabaseContext
|
||||||
|
/// </summary>
|
||||||
|
public DatabaseContext DatabaseContext
|
||||||
|
{
|
||||||
|
get { return ApplicationContext.DatabaseContext; }
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the metadata for this instance
|
/// Returns the metadata for this instance
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Web.Mvc;
|
using System.Web.Mvc;
|
||||||
|
using Umbraco.Core;
|
||||||
using Umbraco.Core.Logging;
|
using Umbraco.Core.Logging;
|
||||||
|
using Umbraco.Core.Services;
|
||||||
using Umbraco.Web.Models;
|
using Umbraco.Web.Models;
|
||||||
using Umbraco.Web.Routing;
|
using Umbraco.Web.Routing;
|
||||||
|
|
||||||
@@ -17,6 +19,15 @@ namespace Umbraco.Web.Mvc
|
|||||||
|
|
||||||
private PublishedContentRequest _publishedContentRequest;
|
private PublishedContentRequest _publishedContentRequest;
|
||||||
|
|
||||||
|
private UmbracoHelper _umbraco;
|
||||||
|
/// <summary>
|
||||||
|
/// Returns an UmbracoHelper object
|
||||||
|
/// </summary>
|
||||||
|
public UmbracoHelper Umbraco
|
||||||
|
{
|
||||||
|
get { return _umbraco ?? (_umbraco = new UmbracoHelper(UmbracoContext)); }
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the current UmbracoContext
|
/// Returns the current UmbracoContext
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -25,6 +36,30 @@ namespace Umbraco.Web.Mvc
|
|||||||
get { return PublishedContentRequest.RoutingContext.UmbracoContext; }
|
get { return PublishedContentRequest.RoutingContext.UmbracoContext; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the current ApplicationContext
|
||||||
|
/// </summary>
|
||||||
|
public ApplicationContext ApplicationContext
|
||||||
|
{
|
||||||
|
get { return UmbracoContext.Application; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a ServiceContext
|
||||||
|
/// </summary>
|
||||||
|
public ServiceContext Services
|
||||||
|
{
|
||||||
|
get { return ApplicationContext.Services; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a DatabaseContext
|
||||||
|
/// </summary>
|
||||||
|
public DatabaseContext DatabaseContext
|
||||||
|
{
|
||||||
|
get { return ApplicationContext.DatabaseContext; }
|
||||||
|
}
|
||||||
|
|
||||||
//TODO: make this protected once we make PublishedContentRequest not internal after we figure out what it should actually contain
|
//TODO: make this protected once we make PublishedContentRequest not internal after we figure out what it should actually contain
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the current PublishedContentRequest
|
/// Returns the current PublishedContentRequest
|
||||||
|
|||||||
Reference in New Issue
Block a user