diff --git a/src/Moryx.AbstractionLayer.Products.Endpoints/ProductConverter.cs b/src/Moryx.AbstractionLayer.Products.Endpoints/ProductConverter.cs index d0c2313c9..287309c43 100644 --- a/src/Moryx.AbstractionLayer.Products.Endpoints/ProductConverter.cs +++ b/src/Moryx.AbstractionLayer.Products.Endpoints/ProductConverter.cs @@ -27,16 +27,22 @@ public ProductConverter(IProductManagement productManagement) { _productManagement = productManagement; } + public ProductDefinitionModel ConvertProductType(Type productType) { + var baseType = productType.BaseType; + var baseTypeName = baseType == typeof(ProductType) + ? string.Empty : baseType.FullName; + return new() { Name = productType.FullName, DisplayName = productType.GetDisplayName() ?? productType.Name, - BaseDefinition = productType.BaseType?.Name, + BaseDefinition = baseTypeName, Properties = EntryConvert.EncodeClass(productType, ProductSerialization) }; } + public RecipeDefinitionModel ConvertRecipeType(Type recipeType) { return new()