public async Task <IActionResult> Edit(int id) { if (id == 0) { return(RedirectToAction(nameof(Index))); } var apiResource = await _apiResourceService.GetApiResourceByIdAsync(id); if (apiResource == null) { return(RedirectToAction(nameof(Index))); } return(View(CommonMappers.Mapper.Map <ApiResourceModel>(apiResource))); }
public async Task <IActionResult> Edit(int id) { var jsonSerializerSettings = new JsonSerializerSettings() { ReferenceLoopHandling = ReferenceLoopHandling.Ignore }; var apiResource = await _service.GetApiResourceByIdAsync(id); var jsonString = JsonConvert.SerializeObject(apiResource, Formatting.None, jsonSerializerSettings); ViewData["Data"] = jsonString; return(View()); }
public Task <ApiResourceDto> GetApiResourceByIdAsync(int id) { return(apiResourceService.GetApiResourceByIdAsync(id)); }