public void ProcessNewHoldingComponents(SaveHoldingViewModel components) { var portfolio = portfolioRepository.GetSingle(p => p.Id == components.PortfolioId); var newComps = new SavePortfolioViewModel { YahooCode = components.YahooCode, PurchaseAmount = components.PurchaseAmount, PurchaseDate = components.PurchaseDate, PurchasePrice = components.PurchasePrice, PurchaseFees = components.PurchaseFees, CustomName = components.CustomName }; ProcessNewPortfolioComponents(portfolio, newComps); }
public async Task<IActionResult> CreateHolding([FromBody] SaveHoldingViewModel holdingViewModel) { if (!ModelState.IsValid) return BadRequest(ModelState); BackgroundJob.Enqueue<BackgroundProcessingService>(service => service.ProcessNewHoldingComponents(holdingViewModel)); var response = new TransactionIdentifierViewModel { Id = 1 }; return Ok(response); }