diff --git a/src/Umbraco.Web/Controllers/UmbLoginController.cs b/src/Umbraco.Web/Controllers/UmbLoginController.cs
index 2b70f927b7..54703e28bd 100644
--- a/src/Umbraco.Web/Controllers/UmbLoginController.cs
+++ b/src/Umbraco.Web/Controllers/UmbLoginController.cs
@@ -2,11 +2,25 @@
using Umbraco.Web.Models;
using Umbraco.Web.Mvc;
using Umbraco.Core;
+using Umbraco.Core.Cache;
+using Umbraco.Core.Logging;
+using Umbraco.Core.Persistence;
+using Umbraco.Core.Services;
namespace Umbraco.Web.Controllers
{
public class UmbLoginController : SurfaceController
{
+ // fixme - delete?
+ public UmbLoginController()
+ {
+ }
+
+ public UmbLoginController(UmbracoContext umbracoContext, IUmbracoDatabaseFactory databaseFactory, ServiceContext services, CacheHelper applicationCache, ILogger logger, ProfilingLogger profilingLogger)
+ : base(umbracoContext, databaseFactory, services, applicationCache, logger, profilingLogger)
+ {
+ }
+
[HttpPost]
public ActionResult HandleLogin([Bind(Prefix = "loginModel")]LoginModel model)
{
diff --git a/src/Umbraco.Web/Controllers/UmbLoginStatusController.cs b/src/Umbraco.Web/Controllers/UmbLoginStatusController.cs
index 0364359673..8df46078ff 100644
--- a/src/Umbraco.Web/Controllers/UmbLoginStatusController.cs
+++ b/src/Umbraco.Web/Controllers/UmbLoginStatusController.cs
@@ -3,12 +3,25 @@ using System.Web.Security;
using Umbraco.Web.Models;
using Umbraco.Web.Mvc;
using Umbraco.Core;
+using Umbraco.Core.Cache;
+using Umbraco.Core.Logging;
+using Umbraco.Core.Persistence;
+using Umbraco.Core.Services;
namespace Umbraco.Web.Controllers
{
[MemberAuthorize]
public class UmbLoginStatusController : SurfaceController
- {
+ {
+ // fixme - delete?
+ public UmbLoginStatusController()
+ {
+ }
+
+ public UmbLoginStatusController(UmbracoContext umbracoContext, IUmbracoDatabaseFactory databaseFactory, ServiceContext services, CacheHelper applicationCache, ILogger logger, ProfilingLogger profilingLogger) : base(umbracoContext, databaseFactory, services, applicationCache, logger, profilingLogger)
+ {
+ }
+
[HttpPost]
public ActionResult HandleLogout([Bind(Prefix = "logoutModel")]PostRedirectModel model)
{
diff --git a/src/Umbraco.Web/Controllers/UmbProfileController.cs b/src/Umbraco.Web/Controllers/UmbProfileController.cs
index 27c5c32a02..5cb5d1b83e 100644
--- a/src/Umbraco.Web/Controllers/UmbProfileController.cs
+++ b/src/Umbraco.Web/Controllers/UmbProfileController.cs
@@ -4,12 +4,25 @@ using Umbraco.Web.Models;
using Umbraco.Web.Mvc;
using Umbraco.Core.Security;
using Umbraco.Core;
+using Umbraco.Core.Cache;
+using Umbraco.Core.Logging;
+using Umbraco.Core.Persistence;
+using Umbraco.Core.Services;
namespace Umbraco.Web.Controllers
{
[MemberAuthorize]
public class UmbProfileController : SurfaceController
{
+ // fixme - delete?
+ public UmbProfileController()
+ {
+ }
+
+ public UmbProfileController(UmbracoContext umbracoContext, IUmbracoDatabaseFactory databaseFactory, ServiceContext services, CacheHelper applicationCache, ILogger logger, ProfilingLogger profilingLogger) : base(umbracoContext, databaseFactory, services, applicationCache, logger, profilingLogger)
+ {
+ }
+
[HttpPost]
public ActionResult HandleUpdateProfile([Bind(Prefix = "profileModel")] ProfileModel model)
{
diff --git a/src/Umbraco.Web/Controllers/UmbRegisterController.cs b/src/Umbraco.Web/Controllers/UmbRegisterController.cs
index 64f54dd465..a0960e21ee 100644
--- a/src/Umbraco.Web/Controllers/UmbRegisterController.cs
+++ b/src/Umbraco.Web/Controllers/UmbRegisterController.cs
@@ -2,13 +2,26 @@
using System.Web.Mvc;
using System.Web.Security;
using Umbraco.Core;
+using Umbraco.Core.Cache;
+using Umbraco.Core.Logging;
+using Umbraco.Core.Persistence;
+using Umbraco.Core.Services;
using Umbraco.Web.Models;
using Umbraco.Web.Mvc;
namespace Umbraco.Web.Controllers
{
public class UmbRegisterController : SurfaceController
- {
+ {
+ // fixme - delete?
+ public UmbRegisterController()
+ {
+ }
+
+ public UmbRegisterController(UmbracoContext umbracoContext, IUmbracoDatabaseFactory databaseFactory, ServiceContext services, CacheHelper applicationCache, ILogger logger, ProfilingLogger profilingLogger) : base(umbracoContext, databaseFactory, services, applicationCache, logger, profilingLogger)
+ {
+ }
+
[HttpPost]
public ActionResult HandleRegisterMember([Bind(Prefix = "registerModel")]RegisterModel model)
{
diff --git a/src/Umbraco.Web/Editors/AuthenticationController.cs b/src/Umbraco.Web/Editors/AuthenticationController.cs
index 50cad49657..f4066520e2 100644
--- a/src/Umbraco.Web/Editors/AuthenticationController.cs
+++ b/src/Umbraco.Web/Editors/AuthenticationController.cs
@@ -11,8 +11,8 @@ using System.Web.Mvc;
using AutoMapper;
using Microsoft.AspNet.Identity;
using Microsoft.AspNet.Identity.Owin;
-using Microsoft.Owin;
using Umbraco.Core;
+using Umbraco.Core.Cache;
using Umbraco.Core.Models;
using Umbraco.Core.Models.Identity;
using Umbraco.Core.Security;
@@ -26,6 +26,7 @@ using Umbraco.Web.WebApi;
using Umbraco.Web.WebApi.Filters;
using Umbraco.Core.Configuration;
using Umbraco.Core.Logging;
+using Umbraco.Core.Persistence;
using Umbraco.Web.Composing;
using IUser = Umbraco.Core.Models.Membership.IUser;
@@ -53,6 +54,15 @@ namespace Umbraco.Web.Editors
get { return _signInManager ?? (_signInManager = TryGetOwinContext().Result.GetBackOfficeSignInManager()); }
}
+ public AuthenticationController()
+ {
+ }
+
+ public AuthenticationController(IGlobalSettings globalSettings, UmbracoContext umbracoContext, ISqlContext sqlContext, ServiceContext services, CacheHelper applicationCache, ILogger logger, ProfilingLogger profilingLogger, IRuntimeState runtimeState)
+ : base(globalSettings, umbracoContext, sqlContext, services, applicationCache, logger, profilingLogger, runtimeState)
+ {
+ }
+
///
/// Returns the configuration for the backoffice user membership provider - used to configure the change password dialog
///
diff --git a/src/Umbraco.Web/Editors/BackOfficeController.cs b/src/Umbraco.Web/Editors/BackOfficeController.cs
index 1988808d23..f251956649 100644
--- a/src/Umbraco.Web/Editors/BackOfficeController.cs
+++ b/src/Umbraco.Web/Editors/BackOfficeController.cs
@@ -23,6 +23,7 @@ using Umbraco.Core.Logging;
using Umbraco.Core.Manifest;
using Umbraco.Core.Models.Identity;
using Umbraco.Core.Models.Membership;
+using Umbraco.Core.Persistence;
using Umbraco.Core.Security;
using Umbraco.Web.Models;
using Umbraco.Web.Mvc;
@@ -55,7 +56,13 @@ namespace Umbraco.Web.Editors
private const string TokenPasswordResetCode = "PasswordResetCode";
private static readonly string[] TempDataTokenNames = { TokenExternalSignInError, TokenPasswordResetCode };
- public BackOfficeController(ManifestParser manifestParser, UmbracoFeatures features)
+ //public BackOfficeController(ManifestParser manifestParser, UmbracoFeatures features)
+ //{
+ // _manifestParser = manifestParser;
+ // _features = features;
+ //}
+
+ public BackOfficeController(ManifestParser manifestParser, UmbracoFeatures features, IGlobalSettings globalSettings, UmbracoContext umbracoContext, IUmbracoDatabaseFactory databaseFactory, ServiceContext services, CacheHelper applicationCache, ILogger logger, ProfilingLogger profilingLogger) : base(globalSettings, umbracoContext, databaseFactory, services, applicationCache, logger, profilingLogger)
{
_manifestParser = manifestParser;
_features = features;
diff --git a/src/Umbraco.Web/Editors/DashboardController.cs b/src/Umbraco.Web/Editors/DashboardController.cs
index d23e262412..37c72d2e02 100644
--- a/src/Umbraco.Web/Editors/DashboardController.cs
+++ b/src/Umbraco.Web/Editors/DashboardController.cs
@@ -3,8 +3,6 @@ using Umbraco.Core;
using Umbraco.Core.Configuration;
using Umbraco.Web.Models.ContentEditing;
using Umbraco.Web.Mvc;
-using System.Linq;
-using Umbraco.Core.IO;
using Newtonsoft.Json.Linq;
using System.Threading.Tasks;
using System.Net.Http;
@@ -16,6 +14,8 @@ using Umbraco.Core.Cache;
using Umbraco.Web.WebApi;
using Umbraco.Web.WebApi.Filters;
using Umbraco.Core.Logging;
+using Umbraco.Core.Persistence;
+using Umbraco.Core.Services;
namespace Umbraco.Web.Editors
{
@@ -27,6 +27,15 @@ namespace Umbraco.Web.Editors
[WebApi.UmbracoAuthorize]
public class DashboardController : UmbracoApiController
{
+ public DashboardController()
+ {
+ }
+
+ public DashboardController(IGlobalSettings globalSettings, UmbracoContext umbracoContext, ISqlContext sqlContext, ServiceContext services, CacheHelper applicationCache, ILogger logger, ProfilingLogger profilingLogger, IRuntimeState runtimeState)
+ : base(globalSettings, umbracoContext, sqlContext, services, applicationCache, logger, profilingLogger, runtimeState)
+ {
+ }
+
//we have baseurl as a param to make previewing easier, so we can test with a dev domain from client side
[ValidateAngularAntiForgeryToken]
public async Task GetRemoteDashboardContent(string section, string baseUrl = "https://dashboard.umbraco.org/")
diff --git a/src/Umbraco.Web/Mvc/PluginController.cs b/src/Umbraco.Web/Mvc/PluginController.cs
index 6b5f111585..6e44cca112 100644
--- a/src/Umbraco.Web/Mvc/PluginController.cs
+++ b/src/Umbraco.Web/Mvc/PluginController.cs
@@ -1,7 +1,6 @@
using System;
using System.Collections.Concurrent;
using System.Web.Mvc;
-using LightInject;
using Umbraco.Core;
using Umbraco.Core.Cache;
using Umbraco.Core.Logging;
@@ -36,37 +35,31 @@ namespace Umbraco.Web.Mvc
///
/// Gets or sets the Umbraco context.
///
- [Inject]
public virtual UmbracoContext UmbracoContext { get; set; }
///
/// Gets or sets the database context.
///
- [Inject]
public IUmbracoDatabaseFactory DatabaseFactory { get; set; }
///
/// Gets or sets the services context.
///
- [Inject]
public ServiceContext Services { get; set; }
///
/// Gets or sets the application cache.
///
- [Inject]
public CacheHelper ApplicationCache { get; set; }
///
/// Gets or sets the logger.
///
- [Inject]
public ILogger Logger { get; set; }
///
/// Gets or sets the profiling logger.
///
- [Inject]
public ProfilingLogger ProfilingLogger { get; set; }
///
@@ -95,6 +88,28 @@ namespace Umbraco.Web.Mvc
///
internal PluginControllerMetadata Metadata => GetMetadata(GetType());
+ protected PluginController()
+ : this(
+ Current.Container.GetInstance(),
+ Current.Container.GetInstance(),
+ Current.Container.GetInstance(),
+ Current.Container.GetInstance(),
+ Current.Container.GetInstance(),
+ Current.Container.GetInstance()
+ )
+ {
+ }
+
+ protected PluginController(UmbracoContext umbracoContext, IUmbracoDatabaseFactory databaseFactory, ServiceContext services, CacheHelper applicationCache, ILogger logger, ProfilingLogger profilingLogger)
+ {
+ UmbracoContext = umbracoContext;
+ DatabaseFactory = databaseFactory;
+ Services = services;
+ ApplicationCache = applicationCache;
+ Logger = logger;
+ ProfilingLogger = profilingLogger;
+ }
+
///
/// Gets metadata for a controller type.
///
diff --git a/src/Umbraco.Web/Mvc/RenderMvcController.cs b/src/Umbraco.Web/Mvc/RenderMvcController.cs
index e7f336dcde..8077dd48bf 100644
--- a/src/Umbraco.Web/Mvc/RenderMvcController.cs
+++ b/src/Umbraco.Web/Mvc/RenderMvcController.cs
@@ -2,8 +2,10 @@
using System.Web.Mvc;
using Umbraco.Core;
using Umbraco.Core.Cache;
+using Umbraco.Core.Configuration;
using Umbraco.Core.Logging;
using Umbraco.Core.Models.PublishedContent;
+using Umbraco.Core.Persistence;
using Umbraco.Core.Services;
using Umbraco.Web.Models;
using Umbraco.Web.Routing;
@@ -18,11 +20,17 @@ namespace Umbraco.Web.Mvc
{
private PublishedRequest _publishedRequest;
+ // fixme - delete?
public RenderMvcController()
{
ActionInvoker = new RenderActionInvoker();
}
+ public RenderMvcController(IGlobalSettings globalSettings, UmbracoContext umbracoContext, IUmbracoDatabaseFactory databaseFactory, ServiceContext services, CacheHelper applicationCache, ILogger logger, ProfilingLogger profilingLogger) : base(globalSettings, umbracoContext, databaseFactory, services, applicationCache, logger, profilingLogger)
+ {
+ ActionInvoker = new RenderActionInvoker();
+ }
+
///
/// Gets the Umbraco context.
///
diff --git a/src/Umbraco.Web/Mvc/SurfaceController.cs b/src/Umbraco.Web/Mvc/SurfaceController.cs
index 043841f279..bb7538ebe8 100644
--- a/src/Umbraco.Web/Mvc/SurfaceController.cs
+++ b/src/Umbraco.Web/Mvc/SurfaceController.cs
@@ -1,7 +1,11 @@
using System;
using Umbraco.Core;
using System.Collections.Specialized;
+using Umbraco.Core.Cache;
+using Umbraco.Core.Logging;
using Umbraco.Core.Models.PublishedContent;
+using Umbraco.Core.Persistence;
+using Umbraco.Core.Services;
namespace Umbraco.Web.Mvc
{
@@ -12,6 +16,16 @@ namespace Umbraco.Web.Mvc
[MergeParentContextViewData]
public abstract class SurfaceController : PluginController
{
+ // fixme - delete?
+ protected SurfaceController()
+ {
+ }
+
+ protected SurfaceController(UmbracoContext umbracoContext, IUmbracoDatabaseFactory databaseFactory, ServiceContext services, CacheHelper applicationCache, ILogger logger, ProfilingLogger profilingLogger)
+ : base(umbracoContext, databaseFactory, services, applicationCache, logger, profilingLogger)
+ {
+ }
+
///
/// Redirects to the Umbraco page with the given id
///
diff --git a/src/Umbraco.Web/Mvc/UmbracoAuthorizedController.cs b/src/Umbraco.Web/Mvc/UmbracoAuthorizedController.cs
index d0e3ec7b61..e9d287f0df 100644
--- a/src/Umbraco.Web/Mvc/UmbracoAuthorizedController.cs
+++ b/src/Umbraco.Web/Mvc/UmbracoAuthorizedController.cs
@@ -1,4 +1,10 @@
-namespace Umbraco.Web.Mvc
+using Umbraco.Core.Cache;
+using Umbraco.Core.Configuration;
+using Umbraco.Core.Logging;
+using Umbraco.Core.Persistence;
+using Umbraco.Core.Services;
+
+namespace Umbraco.Web.Mvc
{
///
/// Provides a base class for authorized Umbraco controllers.
@@ -10,5 +16,13 @@
[UmbracoAuthorize]
[DisableBrowserCache]
public abstract class UmbracoAuthorizedController : UmbracoController
- { }
+ {
+ protected UmbracoAuthorizedController()
+ {
+ }
+
+ protected UmbracoAuthorizedController(IGlobalSettings globalSettings, UmbracoContext umbracoContext, IUmbracoDatabaseFactory databaseFactory, ServiceContext services, CacheHelper applicationCache, ILogger logger, ProfilingLogger profilingLogger) : base(globalSettings, umbracoContext, databaseFactory, services, applicationCache, logger, profilingLogger)
+ {
+ }
+ }
}
diff --git a/src/Umbraco.Web/Mvc/UmbracoController.cs b/src/Umbraco.Web/Mvc/UmbracoController.cs
index 6f4034fe85..520724bcaf 100644
--- a/src/Umbraco.Web/Mvc/UmbracoController.cs
+++ b/src/Umbraco.Web/Mvc/UmbracoController.cs
@@ -1,10 +1,9 @@
using System;
using System.Web;
using System.Web.Mvc;
-using LightInject;
using Microsoft.Owin;
-using Umbraco.Core;
using Umbraco.Core.Cache;
+using Umbraco.Core.Composing;
using Umbraco.Core.Configuration;
using Umbraco.Core.Logging;
using Umbraco.Core.Persistence;
@@ -33,43 +32,36 @@ namespace Umbraco.Web.Mvc
///
/// Gets or sets the Umbraco context.
///
- [Inject]
public virtual IGlobalSettings GlobalSettings { get; set; }
///
/// Gets or sets the Umbraco context.
///
- [Inject]
public virtual UmbracoContext UmbracoContext { get; set; }
///
/// Gets or sets the database context.
///
- [Inject]
public IUmbracoDatabaseFactory DatabaseFactory { get; set; }
///
/// Gets or sets the services context.
///
- [Inject]
public ServiceContext Services { get; set; }
///
/// Gets or sets the application cache.
///
- [Inject]
public CacheHelper ApplicationCache { get; set; }
///
/// Gets or sets the logger.
///
- [Inject]
public ILogger Logger { get; set; }
///
/// Gets or sets the profiling logger.
///
- [Inject]
public ProfilingLogger ProfilingLogger { get; set; }
protected IOwinContext OwinContext => Request.GetOwinContext();
@@ -89,5 +81,29 @@ namespace Umbraco.Web.Mvc
/// Gets the web security helper.
///
public virtual WebSecurity Security => UmbracoContext.Security;
+
+ protected UmbracoController()
+ : this(
+ Current.Container.GetInstance(),
+ Current.Container.GetInstance(),
+ Current.Container.GetInstance(),
+ Current.Container.GetInstance(),
+ Current.Container.GetInstance(),
+ Current.Container.GetInstance(),
+ Current.Container.GetInstance()
+ )
+ {
+ }
+
+ protected UmbracoController(IGlobalSettings globalSettings, UmbracoContext umbracoContext, IUmbracoDatabaseFactory databaseFactory, ServiceContext services, CacheHelper applicationCache, ILogger logger, ProfilingLogger profilingLogger)
+ {
+ GlobalSettings = globalSettings;
+ UmbracoContext = umbracoContext;
+ DatabaseFactory = databaseFactory;
+ Services = services;
+ ApplicationCache = applicationCache;
+ Logger = logger;
+ ProfilingLogger = profilingLogger;
+ }
}
}
diff --git a/src/Umbraco.Web/Mvc/UmbracoViewPageOfTModel.cs b/src/Umbraco.Web/Mvc/UmbracoViewPageOfTModel.cs
index f817b74120..25987d6f30 100644
--- a/src/Umbraco.Web/Mvc/UmbracoViewPageOfTModel.cs
+++ b/src/Umbraco.Web/Mvc/UmbracoViewPageOfTModel.cs
@@ -3,7 +3,6 @@ using System.Text;
using System.Web;
using System.Web.Mvc;
using System.Web.WebPages;
-using LightInject;
using Umbraco.Core;
using Umbraco.Core.Cache;
using Umbraco.Core.Configuration;
@@ -34,13 +33,11 @@ namespace Umbraco.Web.Mvc
///
/// Gets or sets the database context.
///
- [Inject]
public ServiceContext Services { get; set; }
///
/// Gets or sets the application cache.
///
- [Inject]
public CacheHelper ApplicationCache { get; set; }
// fixme
@@ -109,6 +106,20 @@ namespace Umbraco.Web.Mvc
///
public MembershipHelper Members => Umbraco.MembershipHelper;
+ protected UmbracoViewPage()
+ : this(
+ Current.Container.GetInstance(),
+ Current.Container.GetInstance()
+ )
+ {
+ }
+
+ protected UmbracoViewPage(ServiceContext services, CacheHelper applicationCache)
+ {
+ Services = services;
+ ApplicationCache = applicationCache;
+ }
+
// view logic below:
///
diff --git a/src/Umbraco.Web/WebApi/UmbracoApiController.cs b/src/Umbraco.Web/WebApi/UmbracoApiController.cs
index 3616f032d8..61c3f89d41 100644
--- a/src/Umbraco.Web/WebApi/UmbracoApiController.cs
+++ b/src/Umbraco.Web/WebApi/UmbracoApiController.cs
@@ -1,4 +1,10 @@
-using Umbraco.Core.Composing;
+using Umbraco.Core;
+using Umbraco.Core.Cache;
+using Umbraco.Core.Composing;
+using Umbraco.Core.Configuration;
+using Umbraco.Core.Logging;
+using Umbraco.Core.Persistence;
+using Umbraco.Core.Services;
namespace Umbraco.Web.WebApi
{
@@ -6,5 +12,14 @@ namespace Umbraco.Web.WebApi
/// Provides a base class for auto-routed Umbraco API controllers.
///
public abstract class UmbracoApiController : UmbracoApiControllerBase, IDiscoverable
- { }
+ {
+ protected UmbracoApiController()
+ {
+ }
+
+ protected UmbracoApiController(IGlobalSettings globalSettings, UmbracoContext umbracoContext, ISqlContext sqlContext, ServiceContext services, CacheHelper applicationCache, ILogger logger, ProfilingLogger profilingLogger, IRuntimeState runtimeState)
+ : base(globalSettings, umbracoContext, sqlContext, services, applicationCache, logger, profilingLogger, runtimeState)
+ {
+ }
+ }
}
diff --git a/src/Umbraco.Web/WebApi/UmbracoApiControllerBase.cs b/src/Umbraco.Web/WebApi/UmbracoApiControllerBase.cs
index eff5a9cee7..45dedea4ab 100644
--- a/src/Umbraco.Web/WebApi/UmbracoApiControllerBase.cs
+++ b/src/Umbraco.Web/WebApi/UmbracoApiControllerBase.cs
@@ -1,10 +1,10 @@
using System;
using System.Web;
using System.Web.Http;
-using LightInject;
using Microsoft.Owin;
using Umbraco.Core;
using Umbraco.Core.Cache;
+using Umbraco.Core.Composing;
using Umbraco.Core.Configuration;
using Umbraco.Core.Logging;
using Umbraco.Core.Persistence;
@@ -36,50 +36,42 @@ namespace Umbraco.Web.WebApi
///
/// Gets or sets the Umbraco context.
///
- [Inject]
- public virtual IGlobalSettings GlobalSettings { get; set; }
+ public virtual IGlobalSettings GlobalSettings { get; }
///
/// Gets or sets the Umbraco context.
///
- [Inject]
- public virtual UmbracoContext UmbracoContext { get; set; }
+ public virtual UmbracoContext UmbracoContext { get; }
///
/// Gets or sets the sql context.
///
- [Inject]
- public ISqlContext SqlContext { get; set; }
+ public ISqlContext SqlContext { get; }
///
/// Gets or sets the services context.
///
- [Inject]
- public ServiceContext Services { get; set; }
+ public ServiceContext Services { get; }
///
/// Gets or sets the application cache.
///
- [Inject]
- public CacheHelper ApplicationCache { get; set; }
+ public CacheHelper ApplicationCache { get; }
///
/// Gets or sets the logger.
///
- [Inject]
- public ILogger Logger { get; set; }
+ public ILogger Logger { get; }
///
/// Gets or sets the profiling logger.
///
- [Inject]
- public ProfilingLogger ProfilingLogger { get; set; }
+ public ProfilingLogger ProfilingLogger { get; }
///
/// Gets or sets the runtime state.
///
- [Inject]
- internal IRuntimeState RuntimeState { get; set; }
+ internal IRuntimeState RuntimeState { get; }
///
/// Gets the application url.
@@ -102,6 +94,33 @@ namespace Umbraco.Web.WebApi
///
public WebSecurity Security => UmbracoContext.Security;
+ protected UmbracoApiControllerBase()
+ : this(
+ Current.Container.GetInstance(),
+ Current.Container.GetInstance(),
+ Current.Container.GetInstance(),
+ Current.Container.GetInstance(),
+ Current.Container.GetInstance(),
+ Current.Container.GetInstance(),
+ Current.Container.GetInstance(),
+ Current.Container.GetInstance()
+ )
+ {
+ }
+
+ // fixme - Inject fewer things? (Aggregate more)
+ protected UmbracoApiControllerBase(IGlobalSettings globalSettings, UmbracoContext umbracoContext, ISqlContext sqlContext, ServiceContext services, CacheHelper applicationCache, ILogger logger, ProfilingLogger profilingLogger, IRuntimeState runtimeState)
+ {
+ GlobalSettings = globalSettings;
+ UmbracoContext = umbracoContext;
+ SqlContext = sqlContext;
+ Services = services;
+ ApplicationCache = applicationCache;
+ Logger = logger;
+ ProfilingLogger = profilingLogger;
+ RuntimeState = runtimeState;
+ }
+
///
/// Tries to get the current HttpContext.
///
diff --git a/src/Umbraco.Web/WebApi/UmbracoAuthorizedApiController.cs b/src/Umbraco.Web/WebApi/UmbracoAuthorizedApiController.cs
index ad217b43fd..5d60200ed0 100644
--- a/src/Umbraco.Web/WebApi/UmbracoAuthorizedApiController.cs
+++ b/src/Umbraco.Web/WebApi/UmbracoAuthorizedApiController.cs
@@ -1,6 +1,12 @@
-using Umbraco.Web.WebApi.Filters;
+using Umbraco.Core;
+using Umbraco.Core.Cache;
+using Umbraco.Core.Configuration;
+using Umbraco.Core.Logging;
+using Umbraco.Web.WebApi.Filters;
using Umbraco.Core.Models.Identity;
+using Umbraco.Core.Persistence;
using Umbraco.Core.Security;
+using Umbraco.Core.Services;
namespace Umbraco.Web.WebApi
{
@@ -25,5 +31,14 @@ namespace Umbraco.Web.WebApi
protected BackOfficeUserManager UserManager
=> _userManager ?? (_userManager = TryGetOwinContext().Result.GetBackOfficeUserManager());
+
+ protected UmbracoAuthorizedApiController()
+ {
+ }
+
+ protected UmbracoAuthorizedApiController(IGlobalSettings globalSettings, UmbracoContext umbracoContext, ISqlContext sqlContext, ServiceContext services, CacheHelper applicationCache, ILogger logger, ProfilingLogger profilingLogger, IRuntimeState runtimeState)
+ : base(globalSettings, umbracoContext, sqlContext, services, applicationCache, logger, profilingLogger, runtimeState)
+ {
+ }
}
}
diff --git a/src/Umbraco.Web/WebServices/TagsController.cs b/src/Umbraco.Web/WebServices/TagsController.cs
index 6241cfacf0..786bac2693 100644
--- a/src/Umbraco.Web/WebServices/TagsController.cs
+++ b/src/Umbraco.Web/WebServices/TagsController.cs
@@ -1,4 +1,10 @@
using System.Collections.Generic;
+using Umbraco.Core;
+using Umbraco.Core.Cache;
+using Umbraco.Core.Configuration;
+using Umbraco.Core.Logging;
+using Umbraco.Core.Persistence;
+using Umbraco.Core.Services;
using Umbraco.Web.Models;
using Umbraco.Web.WebApi;
@@ -13,6 +19,15 @@ namespace Umbraco.Web.WebServices
///
public class TagsController : UmbracoApiController
{
+ public TagsController()
+ {
+ }
+
+ public TagsController(IGlobalSettings globalSettings, UmbracoContext umbracoContext, ISqlContext sqlContext, ServiceContext services, CacheHelper applicationCache, ILogger logger, ProfilingLogger profilingLogger, IRuntimeState runtimeState)
+ : base(globalSettings, umbracoContext, sqlContext, services, applicationCache, logger, profilingLogger, runtimeState)
+ {
+ }
+
///
/// Get every tag stored in the database (with optional group)
///