Esempio n. 1
0
 /// <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()));
 }
Esempio n. 2
0
 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));
 }
Esempio n. 6
0
 /// <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());
 }
Esempio n. 7
0
 public async Task DeleteAsync <T>(Expression <Func <T, bool> > expression) where T : IEntity
 {
     await DB.DeleteAsync(expression, Session, db);
 }
Esempio n. 8
0
 /// <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));
 }
Esempio n. 9
0
 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)));
 }
Esempio n. 11
0
 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));
 }
Esempio n. 13
0
 /// <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));
 }
Esempio n. 15
0
 /// <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()));
 }
Esempio n. 16
0
 public Task <DeleteResult> DeleteAsync <T>(Expression <Func <T, bool> > expression) where T : IEntity
 {
     return(DB.DeleteAsync(expression, Session));
 }
Esempio n. 17
0
 /// <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());
 }
Esempio n. 18
0
 public Task <DeleteResult> DeleteAsync <T>(IEnumerable <string> IDs) where T : IEntity
 {
     return(DB.DeleteAsync <T>(IDs, Session));
 }
Esempio n. 19
0
 public async Task DeleteAsync <T>(string ID) where T : IEntity
 {
     await DB.DeleteAsync <T>(ID, Session, db);
 }
Esempio n. 20
0
 public Task DeleteAsync<T>(string ID) where T : IEntity
 {
     return DB.DeleteAsync<T>(ID, Session, db);
 }
Esempio n. 21
0
 public async Task DeleteAsync <T>(IEnumerable <string> IDs) where T : IEntity
 {
     await DB.DeleteAsync <T>(IDs, Session, db);
 }
Esempio n. 22
0
 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));
 }
Esempio n. 24
0
 /// <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));
 }