v10 make migration from v9 less painful WRT IScope (#12293)

* Restore IEventDispatcher

* Fix breaking changes WRT IScopeProvider and IScope

* Update internal usage.

* Update src/Umbraco.Core/Services/UserService.cs

* Better obsolete message

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>
This commit is contained in:
Paul Johnson
2022-04-26 10:22:37 +01:00
committed by GitHub
parent ef128f9fab
commit 95aa143db0
157 changed files with 2016 additions and 912 deletions

View File

@@ -65,7 +65,7 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers
private readonly IContentVersionService _contentVersionService;
private readonly Lazy<IDictionary<string, ILanguage>> _allLangs;
private readonly ILogger<ContentController> _logger;
private readonly IScopeProvider _scopeProvider;
private readonly ICoreScopeProvider _scopeProvider;
public object? Domains { get; private set; }
@@ -90,7 +90,7 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers
ActionCollection actionCollection,
ISqlContext sqlContext,
IJsonSerializer serializer,
IScopeProvider scopeProvider,
ICoreScopeProvider scopeProvider,
IAuthorizationService authorizationService,
IContentVersionService contentVersionService)
: base(cultureDictionary, loggerFactory, shortStringHelper, eventMessages, localizedTextService, serializer)
@@ -392,7 +392,7 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers
public ActionResult<IDictionary<string, ContentItemDisplay>> GetEmptyByAliases(ContentTypesByAliases contentTypesByAliases)
{
// It's important to do this operation within a scope to reduce the amount of readlock queries.
using var scope = _scopeProvider.CreateScope(autoComplete: true);
using var scope = _scopeProvider.CreateCoreScope(autoComplete: true);
var contentTypes = contentTypesByAliases.ContentTypeAliases?.Select(alias => _contentTypeService.Get(alias)).WhereNotNull();
return GetEmpties(contentTypes, contentTypesByAliases.ParentId).ToDictionary(x => x.ContentTypeAlias);
}
@@ -405,7 +405,7 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers
[OutgoingEditorModelEvent]
public ActionResult<ContentItemDisplay?> GetEmptyByKey(Guid contentTypeKey, int parentId)
{
using (var scope = _scopeProvider.CreateScope())
using (var scope = _scopeProvider.CreateCoreScope())
{
var contentType = _contentTypeService.Get(contentTypeKey);
if (contentType == null)
@@ -497,7 +497,7 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers
private ActionResult<IDictionary<Guid, ContentItemDisplay>> GetEmptyByKeysInternal(Guid[]? contentTypeKeys, int parentId)
{
using var scope = _scopeProvider.CreateScope(autoComplete: true);
using var scope = _scopeProvider.CreateCoreScope(autoComplete: true);
var contentTypes = _contentTypeService.GetAll(contentTypeKeys).ToList();
return GetEmpties(contentTypes, parentId).ToDictionary(x => x.ContentTypeKey);
}