Skip to content

Commit

Permalink
Annotate BaseUrl set with MemberNotNull to prevent CS8618. (#4739)
Browse files Browse the repository at this point in the history
* Annotate BaseUrl set with MemberNotNull to prevent CS8618.

* Updating generated samples

---------

Co-authored-by: Staffan Gustafsson <[email protected]>
  • Loading branch information
powercode and Staffan Gustafsson authored Feb 2, 2024
1 parent be42e58 commit c177153
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
public string BaseUrl
{
get { return _baseUrl; }
[System.Diagnostics.CodeAnalysis.MemberNotNull(nameof(_baseUrl))]
set
{
_baseUrl = value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ namespace MyNamespace
public string BaseUrl
{
get { return _baseUrl; }
[System.Diagnostics.CodeAnalysis.MemberNotNull(nameof(_baseUrl))]
set
{
_baseUrl = value;
Expand Down Expand Up @@ -521,6 +522,7 @@ namespace MyNamespace
public string BaseUrl
{
get { return _baseUrl; }
[System.Diagnostics.CodeAnalysis.MemberNotNull(nameof(_baseUrl))]
set
{
_baseUrl = value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ namespace MyNamespace
public string BaseUrl
{
get { return _baseUrl; }
[System.Diagnostics.CodeAnalysis.MemberNotNull(nameof(_baseUrl))]
set
{
_baseUrl = value;
Expand Down Expand Up @@ -521,6 +522,7 @@ namespace MyNamespace
public string BaseUrl
{
get { return _baseUrl; }
[System.Diagnostics.CodeAnalysis.MemberNotNull(nameof(_baseUrl))]
set
{
_baseUrl = value;
Expand Down
2 changes: 2 additions & 0 deletions src/NSwag.Sample.NET70Minimal/GeneratedClientsCs.gen
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ namespace MyNamespace
public string BaseUrl
{
get { return _baseUrl; }
[System.Diagnostics.CodeAnalysis.MemberNotNull(nameof(_baseUrl))]
set
{
_baseUrl = value;
Expand Down Expand Up @@ -521,6 +522,7 @@ namespace MyNamespace
public string BaseUrl
{
get { return _baseUrl; }
[System.Diagnostics.CodeAnalysis.MemberNotNull(nameof(_baseUrl))]
set
{
_baseUrl = value;
Expand Down
2 changes: 2 additions & 0 deletions src/NSwag.Sample.NET80Minimal/GeneratedClientsCs.gen
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ namespace MyNamespace
public string BaseUrl
{
get { return _baseUrl; }
[System.Diagnostics.CodeAnalysis.MemberNotNull(nameof(_baseUrl))]
set
{
_baseUrl = value;
Expand Down Expand Up @@ -521,6 +522,7 @@ namespace MyNamespace
public string BaseUrl
{
get { return _baseUrl; }
[System.Diagnostics.CodeAnalysis.MemberNotNull(nameof(_baseUrl))]
set
{
_baseUrl = value;
Expand Down

0 comments on commit c177153

Please sign in to comment.