コード例 #1
0
        public async Task <IActionResult> Edit(int id)
        {
            if (id == 0)
            {
                return(RedirectToAction(nameof(Index)));
            }

            var apiScope = await _apiScopeService.GetApiScopeByIdAsync(id);

            if (apiScope == null)
            {
                return(RedirectToAction(nameof(Index)));
            }

            var apiScopeModel = CommonMappers.Mapper.Map <ApiScopeModel>(apiScope);

            return(View(apiScopeModel));
        }
コード例 #2
0
        public async Task <IActionResult> GetApiScopeById(string id)
        {
            var apiScope = await _apiScopeService.GetApiScopeByIdAsync(Int16.Parse(id));

            if (apiScope == null)
            {
                return(NotFound());
            }

            return(Ok(apiScope));
        }
コード例 #3
0
 public Task <ApiScopeDto> GetApiScopeByIdAsync(int id)
 {
     return(apiScopeService.GetApiScopeByIdAsync(id));
 }