* Refactored ManagementApiComposer into several extension classes * ADd support for non-nullable reference types in OpenAPI doc * Update OpenAPI JSON to reflect new (lack of) nullability * Don't add factories twice :) * Rework composing + move backoffice route detection for management API to core
25 lines
912 B
C#
25 lines
912 B
C#
using Microsoft.Extensions.DependencyInjection;
|
|
using Umbraco.Cms.Api.Management.Factories;
|
|
using Umbraco.Cms.Api.Management.Mapping.Relation;
|
|
using Umbraco.Cms.Api.Management.Mapping.TrackedReferences;
|
|
using Umbraco.Cms.Core.DependencyInjection;
|
|
using Umbraco.Cms.Core.Mapping;
|
|
using Umbraco.New.Cms.Infrastructure.Persistence.Mappers;
|
|
|
|
namespace Umbraco.Cms.Api.Management.DependencyInjection;
|
|
|
|
internal static class TrackedReferencesBuilderExtensions
|
|
{
|
|
internal static IUmbracoBuilder AddTrackedReferences(this IUmbracoBuilder builder)
|
|
{
|
|
builder.Services.AddTransient<IRelationViewModelFactory, RelationViewModelFactory>();
|
|
|
|
builder.WithCollectionBuilder<MapDefinitionCollectionBuilder>()
|
|
.Add<TrackedReferenceViewModelsMapDefinition>()
|
|
.Add<RelationModelMapDefinition>()
|
|
.Add<RelationViewModelsMapDefinition>();
|
|
|
|
return builder;
|
|
}
|
|
}
|