From 632733bd420e46993c88ec116403faa2b2a77e3d Mon Sep 17 00:00:00 2001 From: maliming <6908465+maliming@users.noreply.github.com> Date: Fri, 22 May 2020 18:03:54 +0800 Subject: [PATCH] Convert c# type to typescript type. Resolve #4051 --- .../Volo/Abp/Cli/Commands/GenerateProxyCommand.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/GenerateProxyCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/GenerateProxyCommand.cs index 667aa77757..2b524d9272 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/GenerateProxyCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/GenerateProxyCommand.cs @@ -13,6 +13,7 @@ using Volo.Abp.DependencyInjection; using System.Collections.Generic; using System.Linq; using System.Net; +using Volo.Abp.Reflection; namespace Volo.Abp.Cli.Commands { @@ -516,7 +517,16 @@ namespace Volo.Abp.Cli.Commands baseTypeKebabCase = "@abp/ng.core"; baseTypeName = baseType.Split("Volo.Abp.Application.Dtos")[1].Split("<")[0].TrimStart('.'); - customBaseTypeName = baseType.Split("Volo.Abp.Application.Dtos")[1].Replace("System.Guid", "string").TrimStart('.'); + customBaseTypeName = baseType.Split("Volo.Abp.Application.Dtos")[1].TrimStart('.'); + if (customBaseTypeName.Contains("<")) + { + var genericType = customBaseTypeName.Split("<")[1].TrimEnd('>'); + var customBaseType = Type.GetType(genericType); + if (customBaseType != null) + { + customBaseTypeName = customBaseTypeName.Replace(genericType, TypeHelper.GetSimplifiedName(customBaseType)); + } + } } if (baseTypeName.Contains("guid") || baseTypeName.Contains("Guid"))