Skip to content

teqbench/teqbench.system.data.nosql.models

Repository files navigation

System Data NoSql Models

Build Status Badge Build Number Badge Coverage

Overview

Base interface for a repository document model.

Contents

Developer Environment Setup

General

.NET

Usage

Add NuGet Package To Project

dotnet add package TeqBench.System.Data.NoSql.Models

Update Source Code

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; }
}

Licensing

License