Base interface for a repository document model.
- General Tooling
- Configurations
- Coding Standards
- Solutions
- Projects
- Building
- Package & Deployment
- Versioning
dotnet add package TeqBench.System.Data.NoSql.Models
Note
For complete usage, see TeqBench.System.Data.NoSql.MongoDB.Models
/// <summary>
/// Base document interface for MongoDB repository implementation.
/// </summary>
public interface IDocument : IDocument<string>
{
// Note, using the generic IDocument interface from TeqBench.System.Data.NoSql.Models allows
// the implementing interface/class to specific a different data type for the Id property.
}
/// <summary>
/// Base (abstract) document implementation for MongoDB repository implementation.
/// </summary>
public abstract class Document : IDocument
{
/// <summary>
/// Unique document identifier; to be assigned by database when document is created.
/// </summary>
[BsonId]
[BsonRepresentation(BsonType.ObjectId)]
public string Id { get; set; }
}