Example #1
0
        public async Task <Unit> Handle(BulkInsertCommand request, CancellationToken cancellationToken)
        {
            try
            {
                var banks = request.Banks.Select(x => new BankBuilder()
                                                 .WithName(x.Name)
                                                 .WithCode(x.Code)
                                                 .WithIspb(x.ISPB)
                                                 .WithDocument(x.Document)
                                                 .Build())
                            .ToList();

                await _bankRepository.AddRangeAsync(banks);

                await _uow.CommitAsync(cancellationToken);

                return(default);