From fca925e81f586e4007fe76e530714fbd7655f3df Mon Sep 17 00:00:00 2001 From: Thomas Fuchs Date: Tue, 20 Feb 2024 16:14:26 +0100 Subject: [PATCH] Mixed usage of Type.Name and FullName caused UI mismatch --- .../ProductConverter.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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()