Table of Contents

Class Entity

Namespace
MongoDB.Entities
Assembly
MongoDB.Entities.dll

Inherit this class for all entities you want to store in their own collection.

public abstract class Entity : IEntity
Inheritance
Entity
Implements
Derived
Inherited Members
Extension Methods

Properties

ID

This property is auto managed. A new ID will be assigned for new entities upon saving.

[BsonId]
[AsObjectId]
public string ID { get; set; }

Property Value

string

Methods

GenerateNewID()

Override this method in order to control the generation of IDs for new entities.

public virtual object GenerateNewID()

Returns

object

HasDefaultID()

public virtual bool HasDefaultID()

Returns

bool