fixes breaking changes by reintroducing old ctor

This commit is contained in:
Bjarke Berg
2022-04-19 08:55:13 +02:00
parent 852305b7d1
commit c7c3a68691

View File

@@ -1,14 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Events;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Trees;
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.Trees
@@ -21,6 +24,7 @@ namespace Umbraco.Cms.Web.BackOffice.Trees
{
private readonly IMemberGroupService _memberGroupService;
[ActivatorUtilitiesConstructor]
public MemberGroupTreeController(
ILocalizedTextService localizedTextService,
UmbracoApiControllerTypeCollection umbracoApiControllerTypeCollection,
@@ -31,6 +35,24 @@ namespace Umbraco.Cms.Web.BackOffice.Trees
: base(localizedTextService, umbracoApiControllerTypeCollection, menuItemCollectionFactory, eventAggregator, memberTypeService)
=> _memberGroupService = memberGroupService;
[Obsolete("Use ctor with all params")]
public MemberGroupTreeController(
ILocalizedTextService localizedTextService,
UmbracoApiControllerTypeCollection umbracoApiControllerTypeCollection,
IMenuItemCollectionFactory menuItemCollectionFactory,
IMemberGroupService memberGroupService,
IEventAggregator eventAggregator)
: this(localizedTextService,
umbracoApiControllerTypeCollection,
menuItemCollectionFactory,
memberGroupService,
eventAggregator,
StaticServiceProvider.Instance.GetRequiredService<IMemberTypeService>())
{
}
protected override IEnumerable<TreeNode> GetTreeNodesFromService(string id, FormCollection queryStrings)
=> _memberGroupService.GetAll()
.OrderBy(x => x.Name)