Esempio n. 1
0
        public List <CompanyDTO> GetCompanies()
        {
            IEnumerable <Company> companies   = companiesRepository.GetAll();
            List <CompanyDTO>     companyDtos = new List <CompanyDTO>();

            foreach (Company c in companies)
            {
                companyDtos.Add(c.getDTO());
            }
            return(companyDtos);
        }
        public List <CompanyModel> Execute()
        {
            var companies = _repository.GetAll()
                            .Select(x => new CompanyModel
            {
                Id   = x.Id,
                Name = x.Name
            });

            return(companies.ToList());
        }
Esempio n. 3
0
 public IList <AccountsCompaniesSet> GetCompanies()
 {
     return(_companiesRepository.GetAll());
 }
        public IActionResult Get()
        {
            var allCompanies = _companiesRepository.GetAll();

            return(Ok(Mapper.Map <IEnumerable <Company> >(allCompanies)));
        }
Esempio n. 5
0
 public async Task <ICollection <Company> > GetCompanies()
 {
     return(await _companiesRepository.GetAll());
 }