1
0
mirror of synced 2024-11-24 06:20:12 +01:00

Workaround unclosed tag issue, update .gitignore

This commit is contained in:
Yuchen Ji 2022-04-05 03:01:11 +08:00
parent d9c717de6f
commit 001a410cc5
2 changed files with 10 additions and 7 deletions

View File

@ -435,3 +435,5 @@ MigrationBackup/
# Fody - auto-generated XML schema
FodyWeavers.xsd
# Ignore card db since we should start from scratch
/db/card.db3

View File

@ -440,20 +440,21 @@ public class CardServiceController : WebApiController
{
var stringBuilder = new StringBuilder();
for (var i = 0; i < list.Count; i++)
{
var obj = list[i];
obj.RecordId = i + 1;
}
using (var writer = new ChoXmlWriter<T>(stringBuilder))
{
writer.Configuration.OmitXmlDeclaration = false;
writer.Configuration.UseXmlSerialization = true;
writer.WithXPath(xpath);
for (var i = 0; i < list.Count; i++)
{
var obj = list[i];
obj.RecordId = i + 1;
writer.Write(obj);
}
writer.Write(list);
}
stringBuilder.Insert(stringBuilder.Length - 5, "/");
return stringBuilder.ToString();
}