public async Task <IEnumerable <CompanyView> > GetAllCompaniesAsync() { logger.LogInformation("Call GetAllCompaniesAsync method"); var companies = await Task.Run(() => repository.AllCompanies().ToList()); List <CompanyView> companyViews = new List <CompanyView>(); foreach (var c in companies) { companyViews.Add(MappSingleCompany(c)); } return(companyViews); }
public IEnumerable <Company> GetAllCompanies() { logger.LogInformation("Call GetAllCompanies method"); return(repository.AllCompanies().ToList()); }