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:
@@ -136,7 +136,7 @@ namespace Umbraco.Cms.Infrastructure.PublishedCache
|
||||
|
||||
// gets a scope contextual representing a locked writer to the dictionary
|
||||
// TODO: GetScopedWriter? should the dict have a ref onto the scope provider?
|
||||
public IDisposable? GetScopedWriteLock(IScopeProvider scopeProvider)
|
||||
public IDisposable? GetScopedWriteLock(ICoreScopeProvider scopeProvider)
|
||||
{
|
||||
return ScopeContextualBase.Get(scopeProvider, _instanceId, scoped => new ScopedWriteLock(this, scoped));
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace Umbraco.Extensions
|
||||
// TODO: Gotta wonder how much this does actually improve perf? It's a lot of weird code to make this happen so hope it's worth it
|
||||
builder.Services.AddUnique<IIdKeyMap>(factory =>
|
||||
{
|
||||
var idkSvc = new IdKeyMap(factory.GetRequiredService<IScopeProvider>(), factory.GetRequiredService<IScopeAccessor>());
|
||||
var idkSvc = new IdKeyMap(factory.GetRequiredService<ICoreScopeProvider>(), factory.GetRequiredService<IScopeAccessor>());
|
||||
if (factory.GetRequiredService<IPublishedSnapshotService>() is PublishedSnapshotService publishedSnapshotService)
|
||||
{
|
||||
idkSvc.SetMapper(UmbracoObjectTypes.Document, id => publishedSnapshotService.GetDocumentUid(id), uid => publishedSnapshotService.GetDocumentId(uid));
|
||||
|
||||
@@ -698,7 +698,7 @@ AND cmsContentNu.nodeId IS NULL
|
||||
}
|
||||
}
|
||||
|
||||
public ContentNodeKit GetMediaSource(IDatabaseScope scope, int id)
|
||||
public ContentNodeKit GetMediaSource(Scoping.IScope scope, int id)
|
||||
{
|
||||
var sql = SqlMediaSourcesSelect()
|
||||
.Append(SqlObjectTypeNotTrashed(SqlContext, Constants.ObjectTypes.Media))
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace Umbraco.Cms.Infrastructure.PublishedCache.Persistence
|
||||
public NuCacheContentService(
|
||||
INuCacheContentRepository repository,
|
||||
IKeyValueService keyValueService,
|
||||
IScopeProvider provider,
|
||||
ICoreScopeProvider provider,
|
||||
ILoggerFactory loggerFactory,
|
||||
IProfilingLogger profilingLogger,
|
||||
IEventMessagesFactory eventMessagesFactory,
|
||||
@@ -119,7 +119,7 @@ namespace Umbraco.Cms.Infrastructure.PublishedCache.Persistence
|
||||
IReadOnlyCollection<int>? mediaTypeIds = null,
|
||||
IReadOnlyCollection<int>? memberTypeIds = null)
|
||||
{
|
||||
using (IScope scope = ScopeProvider.CreateScope(repositoryCacheMode: RepositoryCacheMode.Scoped))
|
||||
using (ICoreScope scope = ScopeProvider.CreateCoreScope(repositoryCacheMode: RepositoryCacheMode.Scoped))
|
||||
{
|
||||
|
||||
scope.ReadLock(Constants.Locks.ContentTree);
|
||||
@@ -139,7 +139,7 @@ namespace Umbraco.Cms.Infrastructure.PublishedCache.Persistence
|
||||
/// <inheritdoc/>
|
||||
public bool VerifyContentDbCache()
|
||||
{
|
||||
using IScope scope = ScopeProvider.CreateScope(autoComplete: true);
|
||||
using ICoreScope scope = ScopeProvider.CreateCoreScope(autoComplete: true);
|
||||
scope.ReadLock(Constants.Locks.ContentTree);
|
||||
return _repository.VerifyContentDbCache();
|
||||
}
|
||||
@@ -147,7 +147,7 @@ namespace Umbraco.Cms.Infrastructure.PublishedCache.Persistence
|
||||
/// <inheritdoc/>
|
||||
public bool VerifyMediaDbCache()
|
||||
{
|
||||
using IScope scope = ScopeProvider.CreateScope(autoComplete: true);
|
||||
using ICoreScope scope = ScopeProvider.CreateCoreScope(autoComplete: true);
|
||||
scope.ReadLock(Constants.Locks.MediaTree);
|
||||
return _repository.VerifyMediaDbCache();
|
||||
}
|
||||
@@ -155,7 +155,7 @@ namespace Umbraco.Cms.Infrastructure.PublishedCache.Persistence
|
||||
/// <inheritdoc/>
|
||||
public bool VerifyMemberDbCache()
|
||||
{
|
||||
using IScope scope = ScopeProvider.CreateScope(autoComplete: true);
|
||||
using ICoreScope scope = ScopeProvider.CreateCoreScope(autoComplete: true);
|
||||
scope.ReadLock(Constants.Locks.MemberTree);
|
||||
return _repository.VerifyMemberDbCache();
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace Umbraco.Cms.Infrastructure.PublishedCache
|
||||
private readonly IPublishedSnapshotAccessor _publishedSnapshotAccessor;
|
||||
private readonly IVariationContextAccessor _variationContextAccessor;
|
||||
private readonly IProfilingLogger _profilingLogger;
|
||||
private readonly IScopeProvider _scopeProvider;
|
||||
private readonly Scoping.IScopeProvider _scopeProvider;
|
||||
private readonly INuCacheContentService _publishedContentService;
|
||||
private readonly ILogger<PublishedSnapshotService> _logger;
|
||||
private readonly ILoggerFactory _loggerFactory;
|
||||
@@ -85,7 +85,7 @@ namespace Umbraco.Cms.Infrastructure.PublishedCache
|
||||
IVariationContextAccessor variationContextAccessor,
|
||||
IProfilingLogger profilingLogger,
|
||||
ILoggerFactory loggerFactory,
|
||||
IScopeProvider scopeProvider,
|
||||
Scoping.IScopeProvider scopeProvider,
|
||||
INuCacheContentService publishedContentService,
|
||||
IDefaultCultureAccessor defaultCultureAccessor,
|
||||
IOptions<GlobalSettings> globalSettings,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -108,7 +108,7 @@ namespace Umbraco.Cms.Infrastructure.PublishedCache
|
||||
// the dict is write-locked until the write-lock is released
|
||||
// which happens when it is disposed (non-scoped)
|
||||
// or when the scope context exits (scoped)
|
||||
public IDisposable? GetScopedWriteLock(IScopeProvider scopeProvider)
|
||||
public IDisposable? GetScopedWriteLock(ICoreScopeProvider scopeProvider)
|
||||
{
|
||||
return ScopeContextualBase.Get(scopeProvider, _instanceId, scoped => new ScopedWriteLock(this, scoped));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user