コード例 #1
0
        public async Task <Role> Get(GetByIdRoleCommand command)
        {
            var role = await _repository.GetAsync(command.RoleId);

            if (role is null)
            {
                throw new RoleException($"Role id: {command.RoleId} not exist.");
            }

            return(role);
        }
コード例 #2
0
        public async Task <IActionResult> Get([FromQuery] GetByIdRoleCommand getByIdRoleCommand)
        {
            var result = await _roleService.Get(getByIdRoleCommand);

            return(Ok(result));
        }