private StoreViewModel DropdownforCompany() { StoreViewModel dropdown = new StoreViewModel(); dropdown.CompanyList = companyService.GetAll(). Select(p => new CompanyViewModel { CompanyId = p.CompanyId, CompanyName = p.CompanyName }). ToList(); return(dropdown); }
public async Task <IEnumerable <CompanyVm> > BlGetAll() { var getData = await _CompanyRepository.GetAll(); var randomCompany = Mapper.Map <IEnumerable <Company>, IEnumerable <CompanyVm> >(getData); return(randomCompany); }
public override async Task <CompaniesResponse> GetCompanies(EmptyRequest request, ServerCallContext context) { var companies = _companyService.GetAll(); if (companies == null) { _logger.LogError("companies doesn't found"); return(null); } _logger.LogInformation("companies found"); var convertedCompanies = companies.Select(x => _mapper.Map <CompanyResponse>(x)); return(new CompaniesResponse { Companies = { convertedCompanies } }); }
public async Task <ActionResult <Company> > GetCompanies() { var companies = _companyService.GetAll(); if (companies == null) { return(NotFound()); } return(Ok(companies)); }
public IQueryable <Core.Models.Company> GetAll() { return(_company.GetAll()); }
public ResultModel Get() { return(_svr.GetAll()); }