porting 7.6-rc1 into 8
This commit is contained in:
@@ -1,9 +1,6 @@
|
||||
using System;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Routing;
|
||||
using System.Web.UI;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Cache;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Core.Persistence;
|
||||
@@ -20,14 +17,12 @@ namespace Umbraco.Web.UI.Controls
|
||||
|
||||
protected UmbracoControl(UmbracoContext umbracoContext, ServiceContext services, CacheHelper appCache)
|
||||
{
|
||||
if (umbracoContext == null) throw new ArgumentNullException(nameof(umbracoContext));
|
||||
UmbracoContext = umbracoContext;
|
||||
UmbracoContext = umbracoContext ?? throw new ArgumentNullException(nameof(umbracoContext));
|
||||
Umbraco = new UmbracoHelper(umbracoContext, services, appCache);
|
||||
|
||||
// fixme inject somehow
|
||||
Logger = Current.Logger;
|
||||
ProfilingLogger = Current.ProfilingLogger;
|
||||
DatabaseFactory = Current.DatabaseFactory;
|
||||
Services = Current.Services;
|
||||
}
|
||||
|
||||
@@ -58,11 +53,6 @@ namespace Umbraco.Web.UI.Controls
|
||||
/// </summary>
|
||||
public UmbracoContext UmbracoContext { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the database context.
|
||||
/// </summary>
|
||||
protected IUmbracoDatabaseFactory DatabaseFactory { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the services context.
|
||||
/// </summary>
|
||||
@@ -72,6 +62,6 @@ namespace Umbraco.Web.UI.Controls
|
||||
/// Gets a Url helper.
|
||||
/// </summary>
|
||||
/// <remarks>This URL helper is created without any route data and an empty request context.</remarks>
|
||||
public UrlHelper Url => _url ?? (_url = new UrlHelper(new RequestContext(new HttpContextWrapper(Context), new RouteData())));
|
||||
public UrlHelper Url => _url ?? (_url = new UrlHelper(Context.Request.RequestContext));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user