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); }
public async Task <IActionResult> Get([FromQuery] GetByIdRoleCommand getByIdRoleCommand) { var result = await _roleService.Get(getByIdRoleCommand); return(Ok(result)); }