public async Task <IEnumerable <ProducerDTO> > GetAll() { var producers = await _producerRepo.GetAll(); if (producers == null) { return(null); } producers = producers.Where(p => p.AuthStatus == AuthStatus.Approved); List <ProducerDTO> producers_result = new List <ProducerDTO>(); foreach (Producer producer in producers) { var dto = producer.ToDTO(); producers_result.Add(dto); } return(producers_result); }
public async Task <IEnumerable <Producer> > GetAll() { return(await _producer.GetAll()); }
public IEnumerable <Producer> GetAll() { return(_producerRepository.GetAll()); }
public ActionResult Index() { var Res = Mapper.Map <IEnumerable <Producer>, List <ProducerViewModel> >(_producer.GetAll()); return(View(new SuccessResponceWithData(Res))); }
public async Task <IEnumerable <ProducerDto> > GetAllProducers() => _mapper.Map(await _producerRepository.GetAll(), new List <ProducerDto>());