Skip to content

Commit

Permalink
Merge pull request #385 from PHOENIXCONTACT/fix/product-base-type
Browse files Browse the repository at this point in the history
Port #384 to MORYX 8
  • Loading branch information
Toxantron authored Feb 20, 2024
2 parents 1ca1e9d + fca925e commit 6da70f0
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 6da70f0

Please sign in to comment.