/// <summary> /// Deletes a collection of T's from the database and sets the baskets AscentPayload to the number of records affected /// </summary> /// <param name="basket">A basket</param> /// <param name="visit">The visit the basket is currently making</param> /// <returns>A Task that may be awaited</returns> public async Task AddResultAsync(IDeleteCollectionBasket <T, int> basket, IVisit visit) { if (basket == null) { throw new ArgumentNullException(nameof(basket)); } var statement = GetDeleteDbStatement(basket.DescentPayload); visit.Log(statement.ToString()); basket.AscentPayload = await DbInterface.ExecuteNonQueryAsync(statement).ConfigureAwait(false); }
public Task AddResultAsync(IDeleteCollectionBasket <Frog, int> basket, IVisit visit) { basket.AscentPayload = 5; return(Task.CompletedTask); }
/// <summary> /// Performs no action /// </summary> /// <param name="basket">A basket</param> /// <param name="visit">The visit the basket is currently making</param> /// <returns>A Task that may be awaited</returns> public Task AscendFromAsync(IDeleteCollectionBasket basket, IVisit visit) { return(Task.CompletedTask); }
/// <summary> /// If the user is not allowed to "Delete Collection's" of T's then an UnauthorizedAccessException will be thrown. /// </summary> /// <param name="basket">A basket</param> /// <param name="visit">The visit the basket is currently making</param> /// <returns>A Task that may be awaited</returns> public Task DescendToAsync(IDeleteCollectionBasket basket, IVisit visit) { EnsureOperationAllowed(Operations.DeleteCollection, basket, visit); return(Task.CompletedTask); }
public Task <IDeleteCollectionBasket <Frog, int> > SendAsync(IDeleteCollectionBasket <Frog, int> basket) { return(new Shaft <IDeleteCollectionBasket <Frog, int> >(TerminalLayer) .Add(SecurityLayer) .SendAsync(basket)); }
public Task <IDeleteCollectionBasket <T, int> > SendAsync(IDeleteCollectionBasket <T, int> basket) { return(new Shaft <IDeleteCollectionBasket <T, int> >(TerminalLayer, GetStations <IDeleteCollectionBasket <T, int> >()) .SendAsync(basket)); }