Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
        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)));
        }
Ejemplo n.º 3
0
 private IActionResult GetAllFunds()
 {
     _logger.LogInformation($"GetAllFunds called");
     return(this.Ok(_fundsRepo.GetAll().Select(f => FundViewModel.FromFundDetails(f))));
 }