From a6b53b0a932fe67304870ea10536c79ae4aa95e6 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Tue, 5 Dec 2023 16:49:55 +0100 Subject: [PATCH] Fixing PR #15318 which updated an interface, which is breaking (#15363) --- src/Umbraco.Core/Deploy/IFileTypeCollection.cs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Core/Deploy/IFileTypeCollection.cs b/src/Umbraco.Core/Deploy/IFileTypeCollection.cs index 3fc22192b6..5dc03eb185 100644 --- a/src/Umbraco.Core/Deploy/IFileTypeCollection.cs +++ b/src/Umbraco.Core/Deploy/IFileTypeCollection.cs @@ -27,7 +27,18 @@ public interface IFileTypeCollection /// /// true if the file type associated with the specified entity type was found; otherwise, false. /// - bool TryGetValue(string entityType, [NotNullWhen(true)] out IFileType? fileType); + bool TryGetValue(string entityType, [NotNullWhen(true)] out IFileType? fileType) + { + // TODO (V14): Remove default implementation + if (Contains(entityType)) + { + fileType = this[entityType]; + return true; + } + + fileType = null; + return false; + } /// /// Determines whether this collection contains a file type for the specified entity type. @@ -44,5 +55,5 @@ public interface IFileTypeCollection /// /// The entity types. /// - ICollection GetEntityTypes(); + ICollection GetEntityTypes() => Array.Empty(); // TODO (V14): Remove default implementation }