From 746deb05b2c62345eb9d86de9d5b44965a150b63 Mon Sep 17 00:00:00 2001 From: Arkat Erol Date: Wed, 12 Feb 2020 13:25:29 +0300 Subject: [PATCH] GenerateProxyCommand create type bug fix --- .../Volo/Abp/Cli/Commands/GenerateProxyCommand.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) 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 877f2786ce..e16f2c6c64 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 @@ -334,7 +334,7 @@ namespace Volo.Abp.Cli.Commands } private static string CreateType(JObject data, string returnValueType, string rootPath, List modelIndexList) - { + { var type = data["types"][returnValueType]; if (type == null) @@ -388,10 +388,16 @@ namespace Volo.Abp.Cli.Commands if (baseTypeName.Contains("guid") || baseTypeName.Contains("Guid")) { baseTypeName = "string"; - } + } modelFileText.AppendLine($"import {{ {baseTypeName} }} from '{baseTypeKebabCase}';"); extends = "extends " + (!string.IsNullOrWhiteSpace(customBaseTypeName) ? customBaseTypeName : baseTypeName); + + var modelIndex = CreateType(data, baseType, rootPath, modelIndexList); + if (!string.IsNullOrWhiteSpace(modelIndex)) + { + modelIndexList.Add(modelIndex); + } } if (baseType == "System.Enum" && (bool)type["isEnum"]) @@ -421,11 +427,11 @@ namespace Volo.Abp.Cli.Commands var modelIndex = CreateType(data, (string)property["type"], rootPath, modelIndexList); if (!string.IsNullOrWhiteSpace(modelIndex)) - { + { var propertyTypeSplit = ((string)property["type"]).Split("."); var propertyType = propertyTypeSplit[propertyTypeSplit.Length - 1]; modelFileText.Insert(0,""); - modelFileText.Insert(0, $"import {{ {propertyType} }} from '../models';"); + modelFileText.Insert(0, $"import {{ {propertyType} }} from '../models';"); modelFileText.Insert(0, ""); modelIndexList.Add(modelIndex); }