예제 #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()));
 }
예제 #2
0
 public Task DeleteAsync<T>(IEnumerable<string> IDs) where T : IEntity
 {
     return DB.DeleteAsync<T>(IDs, Session, db);
 }
예제 #3
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>
 async public static Task DeleteAsync <T>(this T entity) where T : Entity
 {
     await DB.DeleteAsync <T>(entity.ID);
 }
예제 #4
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, IClientSessionHandle session = null) where T : IEntity
 {
     return(DB.DeleteAsync <T>(entity.ID, session));
 }
예제 #5
0
 /// <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));
 }
예제 #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());
 }
예제 #7
0
 public async Task DeleteAsync <T>(Expression <Func <T, bool> > expression) where T : IEntity
 {
     await DB.DeleteAsync(expression, Session, db);
 }
예제 #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));
 }
예제 #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)));
 }
예제 #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));
 }
예제 #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));
 }
예제 #14
0
 /// <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));
 }
예제 #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()));
 }
예제 #16
0
 public Task <DeleteResult> DeleteAsync <T>(Expression <Func <T, bool> > expression) where T : IEntity
 {
     return(DB.DeleteAsync(expression, Session));
 }
예제 #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());
 }
예제 #18
0
 public Task <DeleteResult> DeleteAsync <T>(IEnumerable <string> IDs) where T : IEntity
 {
     return(DB.DeleteAsync <T>(IDs, Session));
 }
예제 #19
0
 public async Task DeleteAsync <T>(string ID) where T : IEntity
 {
     await DB.DeleteAsync <T>(ID, Session, db);
 }
예제 #20
0
 public Task DeleteAsync<T>(string ID) where T : IEntity
 {
     return DB.DeleteAsync<T>(ID, Session, db);
 }
예제 #21
0
 public async Task DeleteAsync <T>(IEnumerable <string> IDs) where T : IEntity
 {
     await DB.DeleteAsync <T>(IDs, Session, db);
 }
예제 #22
0
 public Task DeleteAsync<T>(Expression<Func<T, bool>> expression) where T : IEntity
 {
     return DB.DeleteAsync(expression, Session, db);
 }
예제 #23
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, IClientSessionHandle session = null) where T : IEntity
 {
     return(DB.DeleteAsync <T>(entities.Select(e => e.ID), session));
 }
예제 #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));
 }