Search Results for

    Show / Hide Table of Contents

    Interface IEntity

    The contract for Entity classes

    Namespace: MongoDB.Entities
    Assembly: MongoDB.Entities.dll
    Syntax
    public interface IEntity

    Properties

    ID

    The ID property for this entity type.

    IMPORTANT: make sure to decorate this property with the [BsonId] attribute when implementing this interface

    Declaration
    string ID { get; set; }
    Property Value
    Type Description
    String

    Methods

    GenerateNewID()

    Generate and return a new ID string from this method. It will be used when saving new entities that don't have their ID set. That is, if an entity has a null ID, this method will be called for getting a new ID value. If you're not doing custom ID generation, simply do return ObjectId.GenerateNewId().ToString()

    Declaration
    string GenerateNewID()
    Returns
    Type Description
    String

    Extension Methods

    Extensions.Collection<T>(T)
    Extensions.CollectionName<T>(T)
    Extensions.Database<T>(T)
    Extensions.DatabaseName<T>(T)
    Extensions.DeleteAsync<T>(T, IClientSessionHandle, CancellationToken)
    Extensions.Fluent<T>(T, IClientSessionHandle, AggregateOptions)
    Extensions.InitManyToMany<TChild>(IEntity, Expression<Func<Many<TChild>>>, Expression<Func<TChild, Object>>)
    Extensions.InitOneToMany<TChild>(IEntity, Expression<Func<Many<TChild>>>)
    Extensions.InsertAsync<T>(T, IClientSessionHandle, CancellationToken)
    Extensions.NextSequentialNumberAsync<T>(T, CancellationToken)
    Extensions.Queryable<T>(T, AggregateOptions)
    Extensions.SaveAsync<T>(T, IClientSessionHandle, CancellationToken)
    Extensions.SaveExceptAsync<T>(T, IEnumerable<String>, IClientSessionHandle, CancellationToken)
    Extensions.SaveExceptAsync<T>(T, Expression<Func<T, Object>>, IClientSessionHandle, CancellationToken)
    Extensions.SaveOnlyAsync<T>(T, IEnumerable<String>, IClientSessionHandle, CancellationToken)
    Extensions.SaveOnlyAsync<T>(T, Expression<Func<T, Object>>, IClientSessionHandle, CancellationToken)
    Extensions.SavePreservingAsync<T>(T, IClientSessionHandle, CancellationToken)
    Extensions.ToDocument<T>(T)
    Extensions.ToReference<T>(T)
    In this article
    • Properties
      • ID
    • Methods
      • GenerateNewID()
    • Extension Methods
    Back to top Developed by Đĵ ΝιΓΞΗΛψΚ and contributors / Licensed under MIT / Website generated by DocFX