Skip to content

Commit

Permalink
Make requested changes
Browse files Browse the repository at this point in the history
Prevent breaking change by creating a new ctor

Update obsolete message
  • Loading branch information
matthewcare committed Oct 25, 2021
1 parent dac697f commit 576bc1f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Umbraco.Core/IO/ViewHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class ViewHelper : IViewHelper
private readonly IFileSystem _viewFileSystem;
private readonly IDefaultViewContentProvider _defaultViewContentProvider;

[Obsolete("Inject IViewHelper instead")]
[Obsolete("Use ctor with all params")]
public ViewHelper(IFileSystem viewFileSystem) => _viewFileSystem = viewFileSystem ?? throw new ArgumentNullException(nameof(viewFileSystem));

public ViewHelper(FileSystems fileSystems, IDefaultViewContentProvider defaultViewContentProvider)
Expand Down
11 changes: 11 additions & 0 deletions src/Umbraco.Web.BackOffice/Controllers/TemplateController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Linq;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.IO;
using Umbraco.Cms.Core.Mapping;
Expand All @@ -12,6 +13,7 @@
using Umbraco.Cms.Core.Strings;
using Umbraco.Cms.Web.Common.Attributes;
using Umbraco.Cms.Web.Common.Authorization;
using Umbraco.Cms.Web.Common.DependencyInjection;
using Constants = Umbraco.Cms.Core.Constants;

namespace Umbraco.Cms.Web.BackOffice.Controllers
Expand All @@ -38,6 +40,15 @@ public TemplateController(
_defaultViewContentProvider = defaultViewContentProvider ?? throw new ArgumentNullException(nameof(defaultViewContentProvider));
}

[Obsolete("Use ctor will all params")]
public TemplateController(
IFileService fileService,
IUmbracoMapper umbracoMapper,
IShortStringHelper shortStringHelper)
: this(fileService, umbracoMapper, shortStringHelper, StaticServiceProvider.Instance.GetRequiredService<IDefaultViewContentProvider>())
{
}

/// <summary>
/// Gets data type by alias
/// </summary>
Expand Down

0 comments on commit 576bc1f

Please sign in to comment.