public IActionResult Add(int id)
        {
            var viewmodel = new ApiResourceClaimAddViewModel
            {
                ApiResourceId = id,
            };

            return(View(viewmodel));
        }
        public async Task <IActionResult> Add(ApiResourceClaimAddViewModel viewmodel)
        {
            if (ModelState.IsValid)
            {
                var record = _mapper.Map <ApiResourceClaim>(viewmodel);
                _dbContext.ApiResourceClaims.Add(record);

                var result = await _dbContext.SaveChangesAsync().ConfigureAwait(false);

                if (result > 0)
                {
                    return(RedirectToAction("Details", "ApiResources", new { id = viewmodel.ApiResourceId }));
                }

                ModelState.AddModelError("", "Failed");
            }

            return(View(viewmodel));
        }