Files
Umbraco-CMS/src/Umbraco.Web/Profiling/WebProfilingController.cs
T
Elitsa Marinovska 84f19e093a NetCore: Refactor internal usages of UmbracoHelper (#7744)
* Removing properties related to IPublishedContentQuery, ITagQuery, ICultureDictionaryFactory, IUmbracoComponentRenderer from UmbracoHelper and using the corresponding private fields instead. Removing Media related methods

* Removed UmbracoHelper from UmbracoApiControllerBase

* Removed UmbracoHelper references

* Inject the needed Interfaces to classes that previously used UmbracoHelper to get the same functionality

* Fixed tests referencing UmbracoHelper

* Adding Media methods back

* Cleanup and moved UmbracoHelper from more base classes, when not used + simplified tests

* Reintroduced some methods..

* Reintroduced some methods..

* Reintroducing last missing bits

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2020-03-03 11:59:17 +01:00

47 lines
1.5 KiB
C#

using Umbraco.Core;
using Umbraco.Core.Cache;
using Umbraco.Core.Configuration;
using Umbraco.Core.Logging;
using Umbraco.Core.Mapping;
using Umbraco.Core.Persistence;
using Umbraco.Core.Services;
using Umbraco.Core.Strings;
using Umbraco.Web.Editors;
using Umbraco.Web.Routing;
using Umbraco.Web.WebApi.Filters;
namespace Umbraco.Web.Profiling
{
/// <summary>
/// The API controller used to display the state of the web profiler
/// </summary>
[UmbracoApplicationAuthorize(Core.Constants.Applications.Settings)]
public class WebProfilingController : UmbracoAuthorizedJsonController
{
private readonly IRuntimeState _runtimeState;
public WebProfilingController(
IGlobalSettings globalSettings,
IUmbracoContextAccessor umbracoContextAccessor,
ISqlContext sqlContext,
ServiceContext services,
AppCaches appCaches,
IProfilingLogger logger,
IRuntimeState runtimeState,
IShortStringHelper shortStringHelper,
UmbracoMapper umbracoMapper,
IPublishedUrlProvider publishedUrlProvider)
: base(globalSettings, umbracoContextAccessor, sqlContext, services, appCaches, logger, runtimeState, shortStringHelper, umbracoMapper, publishedUrlProvider)
{
_runtimeState = runtimeState;
}
public object GetStatus()
{
return new
{
Enabled = _runtimeState.Debug
};
}
}}