Table of Contents

Class GuidConverter

Namespace
MongoDB.Bson
Assembly
MongoDB.Bson.dll

A static class containing methods to convert to and from Guids and byte arrays in various byte orders.

public static class GuidConverter
Inheritance
GuidConverter
Inherited Members

Methods

FromBytes(byte[], GuidRepresentation)

Converts a byte array to a Guid.

public static Guid FromBytes(byte[] bytes, GuidRepresentation representation)

Parameters

bytes byte[]

The byte array.

representation GuidRepresentation

The representation of the Guid in the byte array.

Returns

Guid

A Guid.

GetSubType(GuidRepresentation)

Gets the sub type that corresponds to the guidRepresentation.

public static BsonBinarySubType GetSubType(GuidRepresentation guidRepresentation)

Parameters

guidRepresentation GuidRepresentation

The Guid representation.

Returns

BsonBinarySubType

The sub type.

ToBytes(Guid, GuidRepresentation)

Converts a Guid to a byte array.

public static byte[] ToBytes(Guid guid, GuidRepresentation guidRepresentation)

Parameters

guid Guid

The Guid.

guidRepresentation GuidRepresentation

The representation of the Guid in the byte array.

Returns

byte[]

A byte array.