Files
Umbraco-CMS/src/Umbraco.Infrastructure/PublishedCache/ReservedFieldNamesService.cs
Kenn Jacobsen 7b422598f9 [V15] Align reserved property endpoints code and usage (#18319)
* Remove/enhance duplicate code

contentTypeEditing Services now use the IReservedFieldNamesService to determine invalid property alias values.

* Let Modelsbuilder define it's reserved property alias names

* Update, add tests + fix false positives

* Removed config check to register modelsbuilder required reserved properties

* Updated unittests regarding removed check of modelsbuilder mode

* Fix merge

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
2025-03-06 09:16:00 +01:00

29 lines
1.2 KiB
C#

using Microsoft.Extensions.Options;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Services;
namespace Umbraco.Cms.Infrastructure.PublishedCache;
internal class ReservedFieldNamesService : IReservedFieldNamesService
{
private readonly ContentPropertySettings _contentPropertySettings;
private readonly MemberPropertySettings _memberPropertySettings;
private readonly MediaPropertySettings _mediaPropertySettings;
public ReservedFieldNamesService(
IOptions<ContentPropertySettings> contentPropertySettings,
IOptions<MemberPropertySettings> memberPropertySettings,
IOptions<MediaPropertySettings> mediaPropertySettings)
{
_contentPropertySettings = contentPropertySettings.Value;
_memberPropertySettings = memberPropertySettings.Value;
_mediaPropertySettings = mediaPropertySettings.Value;
}
public ISet<string> GetDocumentReservedFieldNames() => _contentPropertySettings.ReservedFieldNames;
public ISet<string> GetMediaReservedFieldNames() => _mediaPropertySettings.ReservedFieldNames;
public ISet<string> GetMemberReservedFieldNames() => _memberPropertySettings.ReservedFieldNames;
}