public void Add(TransactionsDto dto) { var domain = new Transactions(); DomainServicesMapper.MapToTransactions(dto, domain); repository.Add(domain); Logger.AddLOGMsg($"Add Transaction with Amount -> {dto.Amount} Sku -> {dto.Sku} Currency -> {dto.Currency}"); }
public void Update(TransactionsDto dto) { var domain = repository.GetByPKs(dto.Sku, dto.Currency); DomainServicesMapper.MapToTransactions(dto, domain); repository.Update(domain); Logger.AddLOGMsg($"Updated Transaction with Amount -> {dto.Amount} Sku -> {dto.Sku} Currency -> {dto.Currency}"); }
private void RefreshTransactionsFromTheResource(IEnumerable <TransactionsDto> dtos) { Logger.AddLOGMsg("Deleted All Transactions"); using (var context = GetNewContext()) { _sqlBulkLogic.BulkDelete(TableName); var domains = new List <Transactions>(); foreach (var dto in dtos) { var domain = new Transactions(); DomainServicesMapper.MapToTransactions(dto, domain); domains.Add(domain); } _sqlBulkLogic.BulkInsert(domains, TableName); } Logger.AddLOGMsg("Saved New Transactions"); }