public IActionResult Get(int id)
        {
            var companyDetails = _companiesRepository.Get(id);

            if (companyDetails == null)
            {
                return(NotFound());
            }

            return(Ok(Mapper.Map <Company>(companyDetails)));
        }
Example #2
0
        public async Task <IActionResult> Search(CompanySearchDTO searchDTO)
        {
            // get companies
            var companies = await _companiesRepository.Get(searchDTO);

            // prepare response with result companies
            var companiesDTOs = companies.Select(e => CompanyDTO.GetFromCompany(e));
            var response      = new { Results = companiesDTOs };

            return(Ok(response));
        }
 public Companies Get(Int64 ixCompany) => _companiesRepository.Get(ixCompany);
Example #4
0
 public async Task <ICollection <Company> > GetCompanies(IEnumerable <string> companySymbols)
 {
     return(await _companiesRepository.Get(companySymbols));
 }
Example #5
0
 public List <Company> GetAllCompanies()
 {
     return(_repository.Get().ToList());
 }