public async Task <IActionResult> PostAsync(CreatePortfolioRequest request, CancellationToken cancellationToken) { _logger.LogInformation("Portfolios/PostAsync was requested."); var response = await _portfolioService.CreateAsync(_mapper.Map <PortfolioDto>(request)); return(Ok(_mapper.Map <PortfolioResponse>(response))); }
public ActionResult CreatePortfolio([FromBody] Portfolio portfolio) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _portfolioService.CreateAsync(portfolio); return(Json(@portfolio)); }