New service and repo to get macros by alias
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Umbraco.Cms.Core.Models;
|
||||
|
||||
namespace Umbraco.Cms.Core.Persistence.Repositories
|
||||
{
|
||||
[Obsolete("This interface will be merged with IMacroRepository in Umbraco 11")]
|
||||
public interface IMacroWithAliasRepository : IMacroRepository
|
||||
{
|
||||
IMacro GetByAlias(string alias);
|
||||
IEnumerable<IMacro> GetAllByAlias(string[] aliases);
|
||||
}
|
||||
}
|
||||
17
src/Umbraco.Core/Services/IMacroWithAliasService.cs
Normal file
17
src/Umbraco.Core/Services/IMacroWithAliasService.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Umbraco.Cms.Core.Models;
|
||||
|
||||
namespace Umbraco.Cms.Core.Services
|
||||
{
|
||||
[Obsolete("This interface will be merged with IMacroService in Umbraco 11")]
|
||||
public interface IMacroWithAliasService : IMacroService
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets a list of available <see cref="IMacro"/> objects by alias.
|
||||
/// </summary>
|
||||
/// <param name="aliases"></param>
|
||||
/// <returns></returns>
|
||||
IEnumerable<IMacro> GetAll(params string[] aliases);
|
||||
}
|
||||
}
|
||||
@@ -36,7 +36,9 @@ namespace Umbraco.Cms.Infrastructure.DependencyInjection
|
||||
builder.Services.AddUnique<IExternalLoginRepository>(factory => factory.GetRequiredService<ExternalLoginRepository>());
|
||||
builder.Services.AddUnique<IExternalLoginWithKeyRepository>(factory => factory.GetRequiredService<ExternalLoginRepository>());
|
||||
builder.Services.AddUnique<ILanguageRepository, LanguageRepository>();
|
||||
builder.Services.AddUnique<IMacroRepository, MacroRepository>();
|
||||
builder.Services.AddUnique<MacroRepository>();
|
||||
builder.Services.AddUnique<IMacroRepository>(factory => factory.GetRequiredService<MacroRepository>());
|
||||
builder.Services.AddUnique<IMacroWithAliasRepository>(factory => factory.GetRequiredService<MacroRepository>());
|
||||
builder.Services.AddUnique<IMediaRepository, MediaRepository>();
|
||||
builder.Services.AddUnique<IMediaTypeContainerRepository, MediaTypeContainerRepository>();
|
||||
builder.Services.AddUnique<IMediaTypeRepository, MediaTypeRepository>();
|
||||
|
||||
@@ -18,9 +18,9 @@ using Umbraco.Cms.Core.Scoping;
|
||||
using Umbraco.Cms.Core.Services;
|
||||
using Umbraco.Cms.Core.Services.Implement;
|
||||
using Umbraco.Cms.Infrastructure.Packaging;
|
||||
using Umbraco.Cms.Infrastructure.Persistence;
|
||||
using Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement;
|
||||
using Umbraco.Cms.Infrastructure.Services.Implement;
|
||||
using Umbraco.Cms.Infrastructure.Templates;
|
||||
using Umbraco.Extensions;
|
||||
|
||||
namespace Umbraco.Cms.Infrastructure.DependencyInjection
|
||||
@@ -64,7 +64,16 @@ namespace Umbraco.Cms.Infrastructure.DependencyInjection
|
||||
builder.Services.AddUnique<IEntityService, EntityService>();
|
||||
builder.Services.AddUnique<IRelationService, RelationService>();
|
||||
builder.Services.AddUnique<ITrackedReferencesService, TrackedReferencesService>();
|
||||
builder.Services.AddUnique<IMacroService, MacroService>();
|
||||
builder.Services.AddUnique<MacroService>(factory => new MacroService(
|
||||
factory.GetRequiredService<IScopeProvider>(),
|
||||
factory.GetRequiredService<ILoggerFactory>(),
|
||||
factory.GetRequiredService<IEventMessagesFactory>(),
|
||||
factory.GetRequiredService<IMacroWithAliasRepository>(),
|
||||
factory.GetRequiredService<IAuditRepository>()
|
||||
));
|
||||
builder.Services.AddUnique<IMacroService>(factory => factory.GetRequiredService<MacroService>());
|
||||
builder.Services.AddUnique<IMacroWithAliasService>(factory => factory.GetRequiredService<MacroService>());
|
||||
|
||||
builder.Services.AddUnique<IMemberTypeService, MemberTypeService>();
|
||||
builder.Services.AddUnique<IMemberGroupService, MemberGroupService>();
|
||||
builder.Services.AddUnique<INotificationService, NotificationService>();
|
||||
@@ -92,6 +101,7 @@ namespace Umbraco.Cms.Infrastructure.DependencyInjection
|
||||
builder.Services.AddUnique<ICreatedPackagesRepository, CreatedPackageSchemaRepository>();
|
||||
builder.Services.AddSingleton<PackageDataInstallation>();
|
||||
builder.Services.AddUnique<IPackageInstallation, PackageInstallation>();
|
||||
builder.Services.AddUnique<IHtmlMacroParameterParser, HtmlMacroParameterParser>();
|
||||
|
||||
return builder;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user