public static ToBytes ( System.Guid guid, GuidRepresentation representation ) : byte[] | ||
guid | System.Guid | The Guid. |
representation | GuidRepresentation | The representation of the Guid in the byte array. |
리턴 | byte[] |
/// <summary> /// Initializes a new instance of the BsonBinaryData class. /// </summary> /// <param name="guid">A Guid.</param> /// <param name="guidRepresentation">The representation for Guids.</param> public BsonBinaryData( Guid guid, GuidRepresentation guidRepresentation ) : this( GuidConverter.ToBytes(guid, guidRepresentation), (guidRepresentation == GuidRepresentation.Standard) ? BsonBinarySubType.UuidStandard : BsonBinarySubType.UuidLegacy, guidRepresentation ) { }
#pragma warning restore 618 /// <summary> /// Initializes a new instance of the BsonBinaryData class. /// </summary> /// <param name="guid">A Guid.</param> /// <param name="guidRepresentation">The representation for Guids.</param> public BsonBinaryData(Guid guid, GuidRepresentation guidRepresentation) { _bytes = GuidConverter.ToBytes(guid, guidRepresentation); _subType = GuidConverter.GetSubType(guidRepresentation); #pragma warning disable 618 if (BsonDefaults.GuidRepresentationMode == GuidRepresentationMode.V2) { _guidRepresentation = guidRepresentation; } #pragma warning restore 618 }