public async Task <IActionResult> Edit(int id) { TempData["active"] = "service"; var editedService = await _serviceService.GetByIdAsync(id); if (editedService != null) { return(View(_mapper.Map <ServiceGeneralDto>(editedService))); } return(NotFound()); }
public async Task <IActionResult> GetAsync(int serviceId) { var service = await _serviceService.GetByIdAsync(serviceId); if (service == null) { return(BadRequest(ModelState.GetErrorMessages())); } var resource = _mapper.Map <Service, ServiceResource>(service.Resource); return(Ok(resource)); }