private IActionResult GetFundsByManager(string name) { _logger.LogInformation($"GetFundsByManager called with {name}"); var funds = _fundsRepo.GetAll(); var filteredByManager = funds .Where(f => f.Name == name) .Select(f => FundViewModel.FromFundDetails(f)); return(this.Ok(filteredByManager)); }
private IActionResult GetFundByCode(string code) { _logger.LogInformation($"GetFundByCode called with {code}"); var funds = _fundsRepo.GetAll(); var fund = funds.SingleOrDefault(x => x.MarketCode == code); if (fund == null) { return(this.NotFound()); } return(this.Ok(FundViewModel.FromFundDetails(fund))); }
private IActionResult GetAllFunds() { _logger.LogInformation($"GetAllFunds called"); return(this.Ok(_fundsRepo.GetAll().Select(f => FundViewModel.FromFundDetails(f)))); }