V15: Refresh IPublishedContentTypeFactory when data types change (#17180)

* Refresh IPublishedContentTypeFactory when data types change

* Add tests
This commit is contained in:
Mole
2024-10-07 11:11:22 +02:00
committed by GitHub
parent aa6bf5606c
commit 2b12eadd3d
6 changed files with 116 additions and 9 deletions

View File

@@ -4,16 +4,16 @@ using Umbraco.Extensions;
namespace Umbraco.Cms.Tests.Common.TestHelpers;
public class ContentTypeUpdateHelper
public static class ContentTypeUpdateHelper
{
public ContentTypeUpdateModel CreateContentTypeUpdateModel(IContentType contentType)
public static ContentTypeUpdateModel CreateContentTypeUpdateModel(IContentType contentType)
{
var updateModel = new ContentTypeUpdateModel();
var model = MapBaseProperties<ContentTypeUpdateModel>(contentType, updateModel);
return model;
}
private T MapBaseProperties<T>(IContentType contentType, T model) where T : ContentTypeModelBase
private static T MapBaseProperties<T>(IContentType contentType, T model) where T : ContentTypeModelBase
{
model.Alias = contentType.Alias;
model.Name = contentType.Name;