2025-07-17 18:26:28 +08:00

26 lines
646 B
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using MongoDB.Bson;
namespace ET
{
[EnableClass]
public abstract class Object
{
public override string ToString()
{
// 这里不能用MongoHelper.ToJson因为单步调试会调用ToString来显示数据
// 如果MongoHelper.ToJson会调用BeginInit,就出大事了
// return MongoHelper.ToJson(this);
return ((object)this).ToJson();
}
public string ToJson()
{
return MongoHelper.ToJson(this);
}
public byte[] ToBson()
{
return MongoHelper.Serialize(this);
}
}
}