From 08c1b1b3df0c7ee0ce4ebeb6ec3fd8e88008af44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=99=BA=E8=83=BD=E5=A4=A7=E7=9F=B3=E5=A4=B4?= Date: Wed, 9 Jul 2025 04:07:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=B1=E7=94=A8Binary=EF=BC=8C=E9=81=BF?= =?UTF-8?q?=E5=85=8D=E9=A2=91=E7=B9=81=E5=88=9B=E5=BB=BA=EF=BC=8C=E6=8F=90?= =?UTF-8?q?=E5=8D=87=E7=99=BE=E4=B8=87=E7=BA=A7=E5=A4=A7=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=8C=81=E4=B9=85=E5=8C=96=E6=80=A7=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- XCode/Entity/EntityExtension.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/XCode/Entity/EntityExtension.cs b/XCode/Entity/EntityExtension.cs index 8584a48d7..3124869a5 100644 --- a/XCode/Entity/EntityExtension.cs +++ b/XCode/Entity/EntityExtension.cs @@ -1220,9 +1220,10 @@ public static class EntityExtension var compressed = file.EndsWithIgnoreCase(".gz"); return file.AsFile().OpenWrite(compressed, fs => { + var bn = new Binary { Stream = fs, EncodeInt = true, FullTime = true }; foreach (var entity in list) { - if (entity is IAccessor acc) acc.Write(fs, null); + if (entity is IAccessor acc) acc.Write(fs, bn); } }); } @@ -1347,11 +1348,12 @@ public static class EntityExtension var compressed = file.EndsWithIgnoreCase(".gz"); file.AsFile().OpenRead(compressed, fs => { + var bn = new Binary { Stream = fs, EncodeInt = true, FullTime = true }; var fact = typeof(T).AsFactory(); while (fs.Position < fs.Length) { var entity = (T)fact.Create(); - if (entity is IAccessor acc) acc.Read(fs, null); + if (entity is IAccessor acc) acc.Read(fs, bn); list.Add(entity); }