var guid = new Guid();
var binary = new BsonBinaryData(guid, GuidRepresentation.Standard);
var result = binary.ToGuid(GuidRepresentation.Standard);
(guid == result).Should().BeTrue();
或:
var bytes = Convert.FromBase64String("E7hI3meCkEC5C/KU8w7BRQ==");
var binaryData = new BsonBinaryData(bytes, BsonBinarySubType.UuidLegacy);
var result = binaryData.ToGuid(GuidRepresentation.CSharpLegacy);
var guid = new Guid(bytes);
(guid == result).Should().BeTrue();
1条答案
按热度按时间nkoocmlb1#
如果没有更多详细信息,请检查以下代码:
或: