public async Task <ActionResult <IEnumerable <ServiceViewModel> > > GetServices() { List <Service> services = await _servicesRepository.GetAll() .Include(s => s.ServiceType).ToListAsync(); return(Ok(_mapper.Map <IEnumerable <ServiceViewModel> >(services))); }
public IActionResult GetAll(string phrase) { var result = _repository .GetAll() .Select(x => new ServiceSearchByPhraseResult(x)) .ToList(); return(Ok(result)); }
public ViewResult Index() { List <Service> services = _sevicesRepository.GetAll().ToList(); foreach (var item in services) { item.Car = _carsrepository.GetCar(item.CarId); item.Client = _clientsRepository.GetClient(item.ClientId); item.Invoice = _invoicesRepository.GetInvoice(item.InvoiceId); } return(View(services)); }
public ServicesQueryResult Handle(ServicesQuery query) { try { var services = _ServicesRepository.GetAll().ToList(); return(new ServicesQueryResult { Services = services }); } catch (Exception ex) { _logger.Log(Logging.Enums.LogCategory.Error, ex); } return(new ServicesQueryResult { }); }
public async Task <IEnumerable <Service> > GetAllServices() { var admins = await _servicesRepository.GetAll(); return(admins.Select(ServiceMapper.Map)); }
public IActionResult Create() { ViewData["ServicesId"] = new SelectList(sr.GetAll(), "Id", "Name"); return(View()); }