C# Class CSMongo.MongoDocument

A document to use for storage with a MongoDatabase
Inheritance: CSMongo.Bson.BsonDocument
Show file Open project: hugoware/CSMongo

Public Methods

Method Description
GenerateId ( ) : MongoOid

Creates an Oid for this document - MongoDB will automatically create an Oid when needed

MongoDocument ( ) : System

Creates an empty MongoDocument with a default ID assigned

MongoDocument ( bool generateId ) : System

Creates an empty MongoDocument with a default ID assigned

MongoDocument ( bool generateId, object source ) : System

Creates a MongoDocument using the provided object as a template

MongoDocument ( object source ) : System

Creates an empty MongoDocument with a default ID assigned

ToBsonByteArray ( ) : byte[]

Handles rendering the bytes required to create this type

operator ( ) : MongoDocument

Merges another object with this object - Same as calling Merge

Protected Methods

Method Description
OnBeforeFinishBsonRender ( IEnumerable fields ) : IEnumerable

Handles reordering so that the Oid is at the start

Method Details

GenerateId() public method

Creates an Oid for this document - MongoDB will automatically create an Oid when needed
public GenerateId ( ) : MongoOid
return MongoOid

MongoDocument() public method

Creates an empty MongoDocument with a default ID assigned
public MongoDocument ( ) : System
return System

MongoDocument() public method

Creates an empty MongoDocument with a default ID assigned
public MongoDocument ( bool generateId ) : System
generateId bool
return System

MongoDocument() public method

Creates a MongoDocument using the provided object as a template
public MongoDocument ( bool generateId, object source ) : System
generateId bool
source object
return System

MongoDocument() public method

Creates an empty MongoDocument with a default ID assigned
public MongoDocument ( object source ) : System
source object
return System

OnBeforeFinishBsonRender() protected method

Handles reordering so that the Oid is at the start
protected OnBeforeFinishBsonRender ( IEnumerable fields ) : IEnumerable
fields IEnumerable
return IEnumerable

ToBsonByteArray() public method

Handles rendering the bytes required to create this type
public ToBsonByteArray ( ) : byte[]
return byte[]

operator() public static method

Merges another object with this object - Same as calling Merge
public static operator ( ) : MongoDocument
return MongoDocument