From 1e1a80b1a798731a0b1e80c64448b6124a9a0415 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E5=81=9A=E7=A0=81=E5=86=9C?= <599854767@qq.com> Date: Mon, 6 Dec 2021 12:52:07 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E4=B8=9A=E5=8A=A1=E5=90=8D=E6=88=AA=E5=8F=96?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ZR.CodeGenerator/CodeGeneratorTool.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ZR.CodeGenerator/CodeGeneratorTool.cs b/ZR.CodeGenerator/CodeGeneratorTool.cs index 9a0c7d6..f118b71 100644 --- a/ZR.CodeGenerator/CodeGeneratorTool.cs +++ b/ZR.CodeGenerator/CodeGeneratorTool.cs @@ -278,9 +278,10 @@ namespace ZR.CodeGenerator /// 业务名 public static string GetBusinessName(string tableName) { - int lastIndex = tableName.LastIndexOf("_"); + int lastIndex = tableName.LastIndexOf("_");//_前缀长度 int nameLength = tableName.Length; - string businessName = tableName[(nameLength - lastIndex + 1)..]; + int subLength = (nameLength - lastIndex) - 1; + string businessName = tableName[(lastIndex + 1)..];// tableName.Substring(lastIndex + 1, subLength); return businessName.ToLower(); }