public async Task <IActionResult> GetById(Guid id)
        {
            var scope = await _scopeRepository.FindByIdAsync(id);

            if (scope == null)
            {
                return(NotFound());
            }
            return(Ok(Mapper.Map <QueryModel.PermissionScope>(scope)));
        }
        public async Task <MessageResult> StartAsync(UpdateScopeCommand command)
        {
            _isCompleted = true;
            var scope = await _repo.FindByIdAsync(command.Id);

            if (scope == null)
            {
                return new MessageResult {
                           Succeed = false,
                           Message = $"PermissionScope of Id {command.Id} doesn't exist."
                }
            }
            ;
            //update
            scope.Description = command.Description;
            scope.DisplayName = command.DisplayName;
            scope.ClaimTypes  = command.ClaimTypes;
            await _repo.SaveAsync(scope);

            return(new MessageResult {
                Succeed = true,
                Message = $"Information of PermissionScope {scope.Id} changed."
            });
        }