public async Task <DiscussionDto[]> GetDiscussionsAsync() { this.IsPending = true; try { if (this.SelectedProjectId == null) { throw new InvalidOperationException("SelectedProjectId is null"); } if (this.SelectedMergeRequestInternalId == null) { throw new InvalidOperationException("SelectedMergeRequestInternalId is null"); } using (var client = new GitLabClient(this.GitOptions)) { var discussions = await client.GetDiscussionsAsync(this.SelectedProjectId.Value, this.SelectedMergeRequestInternalId.Value); return(discussions); } } catch (Exception ex) { this.errorService.AddError(ex); } finally { this.IsPending = false; } return(new DiscussionDto[0]); }