Skip to content

Commit

Permalink
二进制序列化启用FullTime,以支持最大最小的完整时间
Browse files Browse the repository at this point in the history
  • Loading branch information
nnhy committed Aug 5, 2024
1 parent c4b0a18 commit ac4053e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions XCode/DataAccessLayer/DbPackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ public virtual Int32 Restore(Stream stream, IDataTable table)
// 二进制读写器
var bn = new Binary
{
FullTime = true,
EncodeInt = true,
Stream = stream,
};
Expand Down Expand Up @@ -666,6 +667,7 @@ public class WriteFileActor : Actor
// 二进制读写器
_Binary = new Binary
{
FullTime = true,
EncodeInt = true,
Stream = Stream,
};
Expand Down
4 changes: 2 additions & 2 deletions XCode/Entity/Entity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1872,7 +1872,7 @@ public override Object? this[String name]
/// <param name="extend">是否序列化扩展属性</param>
protected virtual Boolean OnRead(Stream stream, Object? context, Boolean extend)
{
if (context is not Binary bn) bn = new Binary { Stream = stream, EncodeInt = true };
if (context is not Binary bn) bn = new Binary { Stream = stream, EncodeInt = true, FullTime = true };

var fs = extend ? Meta.AllFields : Meta.Fields;
foreach (var fi in fs)
Expand All @@ -1890,7 +1890,7 @@ protected virtual Boolean OnRead(Stream stream, Object? context, Boolean extend)
/// <param name="extend">是否序列化扩展属性</param>
protected virtual Boolean OnWrite(Stream stream, Object? context, Boolean extend)
{
if (context is not Binary bn) bn = new Binary { Stream = stream, EncodeInt = true };
if (context is not Binary bn) bn = new Binary { Stream = stream, EncodeInt = true, FullTime = true };

var fs = extend ? Meta.AllFields : Meta.Fields;
foreach (var fi in fs)
Expand Down

0 comments on commit ac4053e

Please sign in to comment.