Class StringObjectIdGenerator
- Namespace
- MongoDB.Bson.Serialization.IdGenerators
- Assembly
- MongoDB.Bson.dll
Represents an Id generator for ObjectIds represented internally as strings.
public class StringObjectIdGenerator : IIdGenerator
- Inheritance
-
StringObjectIdGenerator
- Implements
- Inherited Members
- Extension Methods
Constructors
StringObjectIdGenerator()
Initializes a new instance of the StringObjectIdGenerator class.
public StringObjectIdGenerator()
Properties
Instance
Gets an instance of StringObjectIdGenerator.
public static StringObjectIdGenerator Instance { get; }
Property Value
Methods
GenerateId(object, object)
Generates an Id for a document.
public object GenerateId(object container, object document)
Parameters
container
objectThe container of the document (will be a MongoCollection when called from the C# driver).
document
objectThe document.
Returns
- object
An Id.
IsEmpty(object)
Tests whether an Id is empty.
public bool IsEmpty(object id)
Parameters
id
objectThe Id.
Returns
- bool
True if the Id is empty.