C# Class CSMongo.MongoOid

Represents an ID number to use for MongoOids
Show file Open project: hugoware/CSMongo Class Usage Examples

Public Properties

Property Type Description
MongoOidByteLength int

Public Methods

Method Description
Generate ( ) : byte[]

Generates the bytes for a new MongoOid

GetId ( ) : string

Returns a string version of this ID

MongoOid ( ) : System

Creates a new Oid and generates an Oid automatically

MongoOid ( byte identifier ) : System

Creates an new Oid with the provided bytes - Must be 12 bytes long

MongoOid ( string id ) : System

Creates an ID using a string version of the Oid

SetId ( byte value ) : void

Sets the ID to a specific value using a set of bytes

SetId ( string value ) : void

Converts a string into an ID - IDs should be a hexadecimal string that is either 35 characters (with hyphens) or 24 characters without

ToString ( ) : string

Returns the string format of the Oid

Private Methods

Method Description
_GetIdentifier ( ) : int

Method Details

Generate() public static method

Generates the bytes for a new MongoOid
public static Generate ( ) : byte[]
return byte[]

GetId() public method

Returns a string version of this ID
public GetId ( ) : string
return string

MongoOid() public method

Creates a new Oid and generates an Oid automatically
public MongoOid ( ) : System
return System

MongoOid() public method

Creates an new Oid with the provided bytes - Must be 12 bytes long
public MongoOid ( byte identifier ) : System
identifier byte
return System

MongoOid() public method

Creates an ID using a string version of the Oid
public MongoOid ( string id ) : System
id string
return System

SetId() public method

Sets the ID to a specific value using a set of bytes
public SetId ( byte value ) : void
value byte
return void

SetId() public method

Converts a string into an ID - IDs should be a hexadecimal string that is either 35 characters (with hyphens) or 24 characters without
public SetId ( string value ) : void
value string
return void

ToString() public method

Returns the string format of the Oid
public ToString ( ) : string
return string

Property Details

MongoOidByteLength public static property

The number of bytes to expect from a MongoOid
public static int MongoOidByteLength
return int