Пример #1
0
        /// <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);
        }
Пример #2
0
        public Task AddResultAsync(IDeleteCollectionBasket <Frog, int> basket, IVisit visit)
        {
            basket.AscentPayload = 5;

            return(Task.CompletedTask);
        }
Пример #3
0
 /// <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);
 }
Пример #4
0
 /// <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);
 }
Пример #5
0
 public Task <IDeleteCollectionBasket <Frog, int> > SendAsync(IDeleteCollectionBasket <Frog, int> basket)
 {
     return(new Shaft <IDeleteCollectionBasket <Frog, int> >(TerminalLayer)
            .Add(SecurityLayer)
            .SendAsync(basket));
 }
Пример #6
0
 public Task <IDeleteCollectionBasket <T, int> > SendAsync(IDeleteCollectionBasket <T, int> basket)
 {
     return(new Shaft <IDeleteCollectionBasket <T, int> >(TerminalLayer, GetStations <IDeleteCollectionBasket <T, int> >())
            .SendAsync(basket));
 }