Example #1
0
        public async Task DeleteAllAsync(DeleteAllDto dto)
        {
            using (var transaction = _dbContext.BeginTransaction())
            {
                var tasks = dto.Ids.Select(x => DeleteEntityAsync(x));

                await Task.WhenAll(tasks);

                await transaction.CommitAsync();
            }
        }
        public async Task DeleteAllAsync(DeleteAllDto dto)
        {
            using (var transaction = DbContext.BeginTransaction())
            {
                foreach (var id in dto.Ids)
                {
                    await DeleteAsync(id);
                }

                await transaction.CommitAsync();
            }
        }
Example #3
0
 public Task DeleteAllAsync([FromBody] DeleteAllDto dto)
 {
     return(_commandDispatcher.SendAsync(new DeleteAllProductsCommand {
         Dto = dto
     }));
 }
 public Task DeleteAllAsync(DeleteAllDto dto)
 {
     return(_productService.DeleteAllAsync(dto));
 }
Example #5
0
 public Task DeleteAllAsync(DeleteAllDto dto, [FromServices] IRequestHandler <DeleteAllProductsCommand> handler)
 {
     return(handler.HandleAsync(new DeleteAllProductsCommand {
         Dto = dto
     }));
 }