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(); } }
public Task DeleteAllAsync([FromBody] DeleteAllDto dto) { return(_commandDispatcher.SendAsync(new DeleteAllProductsCommand { Dto = dto })); }
public Task DeleteAllAsync(DeleteAllDto dto) { return(_productService.DeleteAllAsync(dto)); }
public Task DeleteAllAsync(DeleteAllDto dto, [FromServices] IRequestHandler <DeleteAllProductsCommand> handler) { return(handler.HandleAsync(new DeleteAllProductsCommand { Dto = dto })); }