diff --git a/CodeGenerator/CodeGeneratorForm.cs b/CodeGenerator/CodeGeneratorForm.cs index 5ee94dbcc57a3f6b66aaa31797e601128b42c18b..903a35ec32fbe9c797f598fde3e3f228c379cb24 100644 --- a/CodeGenerator/CodeGeneratorForm.cs +++ b/CodeGenerator/CodeGeneratorForm.cs @@ -306,6 +306,7 @@ where a.name = '{0}'"; private string GetProperties(List tableFieldList) { + bool isMultiKey = false; //是否是多主键。 string properties = ""; string sql = ReplaceMarco(); @@ -330,7 +331,8 @@ where a.name = '{0}'"; if (tableFieldInfo.PrimaryKey && tableFieldInfo.TableName == txtMainTable.Text) { - properties += "\t\t[Key]\r\n"; + //properties += "\t\t[Key]\r\n"; + properties += string.Format("\t\t[Key, Column(Order = {0})]\r\n", tableFieldInfo.ColumnId); } else if (tableFieldInfo.Name.ToLower() == "version") {