public async Task <IActionResult> Read(int userId, CancellationToken cancellationToken) { var requestResult = new RequestResult <UserUpdate>() { Model = new UserUpdate() }; var requestResultUser = await _iBusinessUsers.Read(userId, cancellationToken); requestResult.Add(requestResultUser); if (requestResultUser.Succeeded) { requestResult.Model.User = requestResultUser.Model; var requestResultRole = await _iBusinessRoles.Read(cancellationToken); requestResult.Add(requestResultRole); if (requestResultRole.Succeeded) { requestResult.Model.Roles = requestResultRole.Model; } return(Ok(requestResult)); } else { return(NotFound(requestResult)); } }
public async Task <IActionResult> Read(CancellationToken cancellationToken) { var requestResult = await _iBusinessRoles.Read(cancellationToken); return(Ok(requestResult)); }