Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added MemberNotNullWhen in IApiResponse #1483

Merged
merged 4 commits into from
Apr 12, 2023

Conversation

AlbertoMonteiro
Copy link
Contributor

What kind of change does this PR introduce?
Better experience in development when using

What is the current behavior?

N/A

What is the new behavior?

It's just change the developer experience, avoiding using ! operator when is not required.

What might this PR break?

Nothing

Please check if the PR fulfills these requirements

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

Other information:

With that change, if I am in the .NET 5 or higher after the if statement, compiler will know that response.Error is not null and I dont need to use response.Error!

var response = api.GetSomething();
if (!response.IsSuccessStatusCode)
{
    //....
}

_logger.LogError(response.Error, "Message");

@AlbertoMonteiro AlbertoMonteiro marked this pull request as ready for review March 23, 2023 13:04
@glennawatson glennawatson merged commit ed61774 into reactiveui:main Apr 12, 2023
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants