修改默认生成的模板
This commit is contained in:
Binary file not shown.
@@ -495,12 +495,12 @@ namespace ExcelTool
|
||||
sb.Append($"\t\t\t{excelName}Infos[i].Serialize(writer);\n");
|
||||
sb.Append("\t\t}\n");
|
||||
sb.Append("\t}\n\n");
|
||||
sb.Append($"\tpublic IEnumerable<{excelName}> QueryById(int id)\n");
|
||||
sb.Append($"\tpublic {excelName} QueryById(int id)\n");
|
||||
sb.Append("\t{\n");
|
||||
sb.Append($"\t\tvar datas = from d in {excelName}Infos\n");
|
||||
sb.Append($"\t\t\t\t\twhere d.Id == id\n");
|
||||
sb.Append($"\t\t\t\t\tselect d;\n");
|
||||
sb.Append("\t\treturn datas;\n");
|
||||
sb.Append("\t\treturn datas.First();\n");
|
||||
sb.Append("\t}\n");
|
||||
sb.Append("}\n");
|
||||
FileManager.WriteToFile(Path.Combine(outputDir, $"{excelName}.cs"), sb.ToString());
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -137,11 +137,11 @@ public partial class avatarguideTestConfig : IBinarySerializable
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<avatarguideTest> QueryById(int id)
|
||||
public avatarguideTest QueryById(int id)
|
||||
{
|
||||
var datas = from d in avatarguideTestInfos
|
||||
where d.Id == id
|
||||
select d;
|
||||
return datas;
|
||||
return datas.FirstOrDefault();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -166,11 +166,11 @@ public partial class battleSceneConfig : IBinarySerializable
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<battleScene> QueryById(int id)
|
||||
public battleScene QueryById(int id)
|
||||
{
|
||||
var datas = from d in battleSceneInfos
|
||||
where d.Id == id
|
||||
select d;
|
||||
return datas;
|
||||
return datas.FirstOrDefault();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -239,11 +239,11 @@ public partial class official_roomConfig : IBinarySerializable
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<official_room> QueryById(int id)
|
||||
public official_room QueryById(int id)
|
||||
{
|
||||
var datas = from d in official_roomInfos
|
||||
where d.Id == id
|
||||
select d;
|
||||
return datas;
|
||||
return datas.FirstOrDefault();
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user