diff --git a/WaterCloud.CodeGenerator/Template/SingleTableTemplate.cs b/WaterCloud.CodeGenerator/Template/SingleTableTemplate.cs index 152620cdf8aa48827a216126876aa9c1b1246cff..a8a8f33779fb0f4ace2f44444b9c8d45c18e9776 100644 --- a/WaterCloud.CodeGenerator/Template/SingleTableTemplate.cs +++ b/WaterCloud.CodeGenerator/Template/SingleTableTemplate.cs @@ -278,8 +278,7 @@ namespace WaterCloud.CodeGenerator sb.AppendLine(" if (string.IsNullOrEmpty(keyValue))"); sb.AppendLine(" {"); sb.AppendLine(" //此处需修改"); - sb.AppendLine($" entity.{deleteMarkField} = false;"); - sb.AppendLine($" entity.{createTimeField} = DateTime.Now;"); + sb.AppendLine($" entity.{deleteMarkField} = false;"); foreach (DataRow dr in dt.Rows) { string column = dr["TableColumn"].ToString(); @@ -308,6 +307,7 @@ namespace WaterCloud.CodeGenerator { sb.AppendLine(" entity." + idColumn + "=Utils.GuId();"); } + sb.AppendLine($" entity.{createTimeField} = DateTime.Now;"); } else {