/// <summary> /// Deletes a single entity from MongoDB. /// <para>HINT: If this entity is referenced by one-to-many/many-to-many relationships, those references are also deleted.</para> /// </summary> public static Task <DeleteResult> DeleteAsync <T>(this T entity) where T : IEntity { return(DB.DeleteAsync <T>(ID: entity.ID, db: entity.Database())); }
public Task DeleteAsync<T>(IEnumerable<string> IDs) where T : IEntity { return DB.DeleteAsync<T>(IDs, Session, db); }
/// <summary> /// Deletes a single entity from MongoDB. /// <para>HINT: If this entity is referenced by one-to-many/many-to-many relationships, those references are also deleted.</para> /// </summary> async public static Task DeleteAsync <T>(this T entity) where T : Entity { await DB.DeleteAsync <T>(entity.ID); }
/// <summary> /// Deletes a single entity from MongoDB. /// <para>HINT: If this entity is referenced by one-to-many/many-to-many relationships, those references are also deleted.</para> /// </summary> public static Task <DeleteResult> DeleteAsync <T>(this T entity, IClientSessionHandle session = null) where T : IEntity { return(DB.DeleteAsync <T>(entity.ID, session)); }
/// <summary> /// Deletes matching entities from MongoDB /// <para>HINT: If these entities are referenced by one-to-many/many-to-many relationships, those references are also deleted.</para> /// <para>TIP: Try to keep the number of entities to delete under 100 in a single call</para> /// </summary> /// <typeparam name="T">The type of entity</typeparam> /// <param name="expression">A lambda expression for matching entities to delete.</param> /// <param name="cancellation">An optional cancellation token</param> /// <param name="collation">An optional collation object</param> public virtual Task <DeleteResult> DeleteAsync <T>(Expression <Func <T, bool> > expression, CancellationToken cancellation = default, Collation collation = null) where T : IEntity { return(DB.DeleteAsync(expression, session, cancellation, collation)); }
/// <summary> /// Deletes multiple entities from the database /// <para>HINT: If these entities are referenced by one-to-many/many-to-many relationships, those references are also deleted.</para> /// </summary> public static async Task DeleteAllAsync <T>(this IEnumerable <T> entities) where T : IEntity { await DB.DeleteAsync <T>(IDs : entities.Select(e => e.ID), db : entities.First().Database()); }
public async Task DeleteAsync <T>(Expression <Func <T, bool> > expression) where T : IEntity { await DB.DeleteAsync(expression, Session, db); }
/// <summary> /// Deletes a single entity from MongoDB. /// <para>HINT: If this entity is referenced by one-to-many/many-to-many relationships, those references are also deleted.</para> /// </summary> /// <param name="cancellation">An optional cancellation token</param> public static Task <DeleteResult> DeleteAsync <T>(this T entity, IClientSessionHandle session = null, CancellationToken cancellation = default) where T : IEntity { return(DB.DeleteAsync <T>(entity.ID, session, cancellation)); }
public Task <DeleteResult> DeleteAsync <T>(string ID) where T : IEntity { return(DB.DeleteAsync <T>(ID, Session)); }
/// <summary> /// Deletes multiple entities from the database /// <para>HINT: If these entities are referenced by one-to-many/many-to-many relationships, those references are also deleted.</para> /// </summary> public static Task <DeleteResult> DeleteAllAsync <T>(this IEnumerable <T> entities) where T : IEntity { return(DB.DeleteAsync <T>(entities.Select(e => e.ID))); }
public Task <DeleteResult> DeleteAsync <T>(string ID, CancellationToken cancellation = default) where T : IEntity { return(DB.DeleteAsync <T>(ID, Session, db)); }
/// <summary> /// Deletes a single entity from MongoDB. /// <para>HINT: If this entity is referenced by one-to-many/many-to-many relationships, those references are also deleted.</para> /// </summary> public static Task <DeleteResult> DeleteAsync <T>(this T entity) where T : IEntity { return(DB.DeleteAsync <T>(entity.ID)); }
/// <summary> /// Deletes multiple entities from the database /// <para>HINT: If these entities are referenced by one-to-many/many-to-many relationships, those references are also deleted.</para> /// </summary> public static async Task DeleteAllAsync <T>(this IEnumerable <T> entities) where T : Entity { await DB.DeleteAsync <T>(entities.Select(e => e.ID)); }
/// <summary> /// Deletes matching entities from MongoDB /// <para>HINT: If these entities are referenced by one-to-many/many-to-many relationships, those references are also deleted.</para> /// <para>TIP: Try to keep the number of entities to delete under 100 in a single call</para> /// </summary> /// <typeparam name="T">The type of entity</typeparam> /// <param name="IDs">An IEnumerable of entity IDs</param> /// <param name="cancellation">An optional cancellation token</param> public virtual Task <DeleteResult> DeleteAsync <T>(IEnumerable <string> IDs, CancellationToken cancellation = default) where T : IEntity { return(DB.DeleteAsync <T>(IDs, session, cancellation)); }
/// <summary> /// Deletes multiple entities from the database /// <para>HINT: If these entities are referenced by one-to-many/many-to-many relationships, those references are also deleted.</para> /// </summary> public static Task <DeleteResult> DeleteAllAsync <T>(this IEnumerable <T> entities) where T : IEntity { return(DB.DeleteAsync <T>(IDs: entities.Select(e => e.ID), db: entities.First().Database())); }
public Task <DeleteResult> DeleteAsync <T>(Expression <Func <T, bool> > expression) where T : IEntity { return(DB.DeleteAsync(expression, Session)); }
/// <summary> /// Deletes a single entity from MongoDB. /// <para>HINT: If this entity is referenced by one-to-many/many-to-many relationships, those references are also deleted.</para> /// </summary> public static async Task DeleteAsync <T>(this T entity) where T : IEntity { await DB.DeleteAsync <T>(ID : entity.ID, db : entity.Database()); }
public Task <DeleteResult> DeleteAsync <T>(IEnumerable <string> IDs) where T : IEntity { return(DB.DeleteAsync <T>(IDs, Session)); }
public async Task DeleteAsync <T>(string ID) where T : IEntity { await DB.DeleteAsync <T>(ID, Session, db); }
public Task DeleteAsync<T>(string ID) where T : IEntity { return DB.DeleteAsync<T>(ID, Session, db); }
public async Task DeleteAsync <T>(IEnumerable <string> IDs) where T : IEntity { await DB.DeleteAsync <T>(IDs, Session, db); }
public Task DeleteAsync<T>(Expression<Func<T, bool>> expression) where T : IEntity { return DB.DeleteAsync(expression, Session, db); }
/// <summary> /// Deletes multiple entities from the database /// <para>HINT: If these entities are referenced by one-to-many/many-to-many relationships, those references are also deleted.</para> /// </summary> public static Task <DeleteResult> DeleteAllAsync <T>(this IEnumerable <T> entities, IClientSessionHandle session = null) where T : IEntity { return(DB.DeleteAsync <T>(entities.Select(e => e.ID), session)); }
/// <summary> /// Deletes matching entities from MongoDB in the transaction scope /// <para>HINT: If these entities are referenced by one-to-many/many-to-many relationships, those references are also deleted.</para> /// <para>TIP: Try to keep the number of entities to delete under 100 in a single call</para> /// </summary> /// <typeparam name="T">The type of entity</typeparam> /// <param name="expression">A lambda expression for matching entities to delete.</param> /// <param name="cancellation">An optional cancellation token</param> public Task <DeleteResult> DeleteAsync <T>(Expression <Func <T, bool> > expression, CancellationToken cancellation = default) where T : IEntity { return(DB.DeleteAsync(expression, Session, cancellation)); }