[csharp] Fixed operation nested return type (#16314)

* fixed operation nested return type

* more robust fix
This commit is contained in:
devhl-labs
2023-08-14 01:07:36 -04:00
committed by GitHub
parent 83af019603
commit ef9520f989
123 changed files with 8189 additions and 12 deletions

View File

@@ -74,6 +74,8 @@ docs/Quadrilateral.md
docs/QuadrilateralInterface.md
docs/ReadOnlyFirst.md
docs/Return.md
docs/RolesReportsHash.md
docs/RolesReportsHashRole.md
docs/ScaleneTriangle.md
docs/Shape.md
docs/ShapeInterface.md
@@ -188,6 +190,8 @@ src/Org.OpenAPITools/Model/Quadrilateral.cs
src/Org.OpenAPITools/Model/QuadrilateralInterface.cs
src/Org.OpenAPITools/Model/ReadOnlyFirst.cs
src/Org.OpenAPITools/Model/Return.cs
src/Org.OpenAPITools/Model/RolesReportsHash.cs
src/Org.OpenAPITools/Model/RolesReportsHashRole.cs
src/Org.OpenAPITools/Model/ScaleneTriangle.cs
src/Org.OpenAPITools/Model/Shape.cs
src/Org.OpenAPITools/Model/ShapeInterface.cs

View File

@@ -93,6 +93,7 @@ Class | Method | HTTP request | Description
*DefaultApi* | [**FooGet**](DefaultApi.md#fooget) | **GET** /foo |
*DefaultApi* | [**GetCountry**](DefaultApi.md#getcountry) | **POST** /country |
*DefaultApi* | [**Hello**](DefaultApi.md#hello) | **GET** /hello | Hello
*DefaultApi* | [**RolesReportGet**](DefaultApi.md#rolesreportget) | **GET** /roles/report |
*FakeApi* | [**FakeHealthGet**](FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint
*FakeApi* | [**FakeOuterBooleanSerialize**](FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean |
*FakeApi* | [**FakeOuterCompositeSerialize**](FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite |
@@ -203,6 +204,8 @@ Class | Method | HTTP request | Description
- [Model.QuadrilateralInterface](QuadrilateralInterface.md)
- [Model.ReadOnlyFirst](ReadOnlyFirst.md)
- [Model.Return](Return.md)
- [Model.RolesReportsHash](RolesReportsHash.md)
- [Model.RolesReportsHashRole](RolesReportsHashRole.md)
- [Model.ScaleneTriangle](ScaleneTriangle.md)
- [Model.Shape](Shape.md)
- [Model.ShapeInterface](ShapeInterface.md)

View File

@@ -41,6 +41,17 @@ tags:
- description: Operations about user
name: user
paths:
/roles/report:
get:
responses:
"200":
content:
application/json:
schema:
items:
$ref: '#/components/schemas/RolesReport'
type: array
description: returns report
/hello:
get:
description: Hello
@@ -1181,6 +1192,20 @@ components:
description: Pet object that needs to be added to the store
required: true
schemas:
RolesReport:
description: Roles report
items:
$ref: '#/components/schemas/RolesReportsHash'
type: array
RolesReportsHash:
description: Role report Hash
properties:
role_uuid:
format: uuid
type: string
role:
$ref: '#/components/schemas/RolesReportsHash_role'
type: object
Foo:
example:
bar: bar
@@ -2422,6 +2447,11 @@ components:
required:
- country
type: object
RolesReportsHash_role:
properties:
name:
type: string
type: object
securitySchemes:
petstore_auth:
flows:

View File

@@ -7,6 +7,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
| [**FooGet**](DefaultApi.md#fooget) | **GET** /foo | |
| [**GetCountry**](DefaultApi.md#getcountry) | **POST** /country | |
| [**Hello**](DefaultApi.md#hello) | **GET** /hello | Hello |
| [**RolesReportGet**](DefaultApi.md#rolesreportget) | **GET** /roles/report | |
<a id="fooget"></a>
# **FooGet**
@@ -259,3 +260,85 @@ No authorization required
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
<a id="rolesreportget"></a>
# **RolesReportGet**
> List&lt;List&lt;RolesReportsHash&gt;&gt; RolesReportGet ()
### Example
```csharp
using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class RolesReportGetExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new DefaultApi(config);
try
{
List<List<RolesReportsHash>> result = apiInstance.RolesReportGet();
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling DefaultApi.RolesReportGet: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```
#### Using the RolesReportGetWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
```csharp
try
{
ApiResponse<List<List<RolesReportsHash>>> response = apiInstance.RolesReportGetWithHttpInfo();
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exception when calling DefaultApi.RolesReportGetWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
**List<List<RolesReportsHash>>**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | returns report | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

View File

@@ -0,0 +1,12 @@
# Org.OpenAPITools.Model.RolesReportsHash
Role report Hash
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**RoleUuid** | **Guid** | | [optional]
**Role** | [**RolesReportsHashRole**](RolesReportsHashRole.md) | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,10 @@
# Org.OpenAPITools.Model.RolesReportsHashRole
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Name** | **string** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,66 @@
/*
* OpenAPI Petstore
*
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Linq;
using System.IO;
using System.Collections.Generic;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Model;
using Org.OpenAPITools.Client;
using System.Reflection;
using Newtonsoft.Json;
using NUnit.Framework;
namespace Org.OpenAPITools.Test.Model
{
/// <summary>
/// Class for testing RolesReportsHashRole
/// </summary>
/// <remarks>
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the model.
/// </remarks>
public class RolesReportsHashRoleTests : IDisposable
{
// TODO uncomment below to declare an instance variable for RolesReportsHashRole
//private RolesReportsHashRole instance;
public RolesReportsHashRoleTests()
{
// TODO uncomment below to create an instance of RolesReportsHashRole
//instance = new RolesReportsHashRole();
}
public void Dispose()
{
// Cleanup when everything is done.
}
/// <summary>
/// Test an instance of RolesReportsHashRole
/// </summary>
[Test]
public void RolesReportsHashRoleInstanceTest()
{
// TODO uncomment below to test "IsType" RolesReportsHashRole
//Assert.IsType<RolesReportsHashRole>(instance);
}
/// <summary>
/// Test the property 'Name'
/// </summary>
[Test]
public void NameTest()
{
// TODO unit test for the property 'Name'
}
}
}

View File

@@ -0,0 +1,74 @@
/*
* OpenAPI Petstore
*
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Linq;
using System.IO;
using System.Collections.Generic;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Model;
using Org.OpenAPITools.Client;
using System.Reflection;
using Newtonsoft.Json;
using NUnit.Framework;
namespace Org.OpenAPITools.Test.Model
{
/// <summary>
/// Class for testing RolesReportsHash
/// </summary>
/// <remarks>
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the model.
/// </remarks>
public class RolesReportsHashTests : IDisposable
{
// TODO uncomment below to declare an instance variable for RolesReportsHash
//private RolesReportsHash instance;
public RolesReportsHashTests()
{
// TODO uncomment below to create an instance of RolesReportsHash
//instance = new RolesReportsHash();
}
public void Dispose()
{
// Cleanup when everything is done.
}
/// <summary>
/// Test an instance of RolesReportsHash
/// </summary>
[Test]
public void RolesReportsHashInstanceTest()
{
// TODO uncomment below to test "IsType" RolesReportsHash
//Assert.IsType<RolesReportsHash>(instance);
}
/// <summary>
/// Test the property 'RoleUuid'
/// </summary>
[Test]
public void RoleUuidTest()
{
// TODO unit test for the property 'RoleUuid'
}
/// <summary>
/// Test the property 'Role'
/// </summary>
[Test]
public void RoleTest()
{
// TODO unit test for the property 'Role'
}
}
}

View File

@@ -79,6 +79,22 @@ namespace Org.OpenAPITools.Api
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <returns>ApiResponse of List&lt;Guid&gt;</returns>
ApiResponse<List<Guid>> HelloWithHttpInfo();
/// <summary>
///
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <returns>List&lt;List&lt;RolesReportsHash&gt;&gt;</returns>
List<List<RolesReportsHash>> RolesReportGet();
/// <summary>
///
/// </summary>
/// <remarks>
///
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <returns>ApiResponse of List&lt;List&lt;RolesReportsHash&gt;&gt;</returns>
ApiResponse<List<List<RolesReportsHash>>> RolesReportGetWithHttpInfo();
#endregion Synchronous Operations
}
@@ -153,6 +169,27 @@ namespace Org.OpenAPITools.Api
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of ApiResponse (List&lt;Guid&gt;)</returns>
System.Threading.Tasks.Task<ApiResponse<List<Guid>>> HelloWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
/// <summary>
///
/// </summary>
/// <remarks>
///
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of List&lt;List&lt;RolesReportsHash&gt;&gt;</returns>
System.Threading.Tasks.Task<List<List<RolesReportsHash>>> RolesReportGetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
/// <summary>
///
/// </summary>
/// <remarks>
///
/// </remarks>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of ApiResponse (List&lt;List&lt;RolesReportsHash&gt;&gt;)</returns>
System.Threading.Tasks.Task<ApiResponse<List<List<RolesReportsHash>>>> RolesReportGetWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
#endregion Asynchronous Operations
}
@@ -645,5 +682,117 @@ namespace Org.OpenAPITools.Api
return localVarResponse;
}
/// <summary>
///
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <returns>List&lt;List&lt;RolesReportsHash&gt;&gt;</returns>
public List<List<RolesReportsHash>> RolesReportGet()
{
Org.OpenAPITools.Client.ApiResponse<List<List<RolesReportsHash>>> localVarResponse = RolesReportGetWithHttpInfo();
return localVarResponse.Data;
}
/// <summary>
///
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <returns>ApiResponse of List&lt;List&lt;RolesReportsHash&gt;&gt;</returns>
public Org.OpenAPITools.Client.ApiResponse<List<List<RolesReportsHash>>> RolesReportGetWithHttpInfo()
{
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
string[] _contentTypes = new string[] {
};
// to determine the Accept header
string[] _accepts = new string[] {
"application/json"
};
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts);
if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
// make the HTTP request
var localVarResponse = this.Client.Get<List<List<RolesReportsHash>>>("/roles/report", localVarRequestOptions, this.Configuration);
if (this.ExceptionFactory != null)
{
Exception _exception = this.ExceptionFactory("RolesReportGet", localVarResponse);
if (_exception != null) throw _exception;
}
return localVarResponse;
}
/// <summary>
///
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of List&lt;List&lt;RolesReportsHash&gt;&gt;</returns>
public async System.Threading.Tasks.Task<List<List<RolesReportsHash>>> RolesReportGetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
var task = RolesReportGetWithHttpInfoAsync(cancellationToken);
#if UNITY_EDITOR || !UNITY_WEBGL
Org.OpenAPITools.Client.ApiResponse<List<List<RolesReportsHash>>> localVarResponse = await task.ConfigureAwait(false);
#else
Org.OpenAPITools.Client.ApiResponse<List<List<RolesReportsHash>>> localVarResponse = await task;
#endif
return localVarResponse.Data;
}
/// <summary>
///
/// </summary>
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
/// <returns>Task of ApiResponse (List&lt;List&lt;RolesReportsHash&gt;&gt;)</returns>
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<List<List<RolesReportsHash>>>> RolesReportGetWithHttpInfoAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
string[] _contentTypes = new string[] {
};
// to determine the Accept header
string[] _accepts = new string[] {
"application/json"
};
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts);
if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
// make the HTTP request
var task = this.AsynchronousClient.GetAsync<List<List<RolesReportsHash>>>("/roles/report", localVarRequestOptions, this.Configuration, cancellationToken);
#if UNITY_EDITOR || !UNITY_WEBGL
var localVarResponse = await task.ConfigureAwait(false);
#else
var localVarResponse = await task;
#endif
if (this.ExceptionFactory != null)
{
Exception _exception = this.ExceptionFactory("RolesReportGet", localVarResponse);
if (_exception != null) throw _exception;
}
return localVarResponse;
}
}
}

View File

@@ -0,0 +1,136 @@
/*
* OpenAPI Petstore
*
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
namespace Org.OpenAPITools.Model
{
/// <summary>
/// Role report Hash
/// </summary>
[DataContract(Name = "RolesReportsHash")]
public partial class RolesReportsHash : IEquatable<RolesReportsHash>
{
/// <summary>
/// Initializes a new instance of the <see cref="RolesReportsHash" /> class.
/// </summary>
/// <param name="roleUuid">roleUuid.</param>
/// <param name="role">role.</param>
public RolesReportsHash(Guid roleUuid = default(Guid), RolesReportsHashRole role = default(RolesReportsHashRole))
{
this.RoleUuid = roleUuid;
this.Role = role;
}
/// <summary>
/// Gets or Sets RoleUuid
/// </summary>
[DataMember(Name = "role_uuid", EmitDefaultValue = false)]
public Guid RoleUuid { get; set; }
/// <summary>
/// Gets or Sets Role
/// </summary>
[DataMember(Name = "role", EmitDefaultValue = false)]
public RolesReportsHashRole Role { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append("class RolesReportsHash {\n");
sb.Append(" RoleUuid: ").Append(RoleUuid).Append("\n");
sb.Append(" Role: ").Append(Role).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
}
/// <summary>
/// Returns true if objects are equal
/// </summary>
/// <param name="input">Object to be compared</param>
/// <returns>Boolean</returns>
public override bool Equals(object input)
{
return this.Equals(input as RolesReportsHash);
}
/// <summary>
/// Returns true if RolesReportsHash instances are equal
/// </summary>
/// <param name="input">Instance of RolesReportsHash to be compared</param>
/// <returns>Boolean</returns>
public bool Equals(RolesReportsHash input)
{
if (input == null)
{
return false;
}
return
(
this.RoleUuid == input.RoleUuid ||
(this.RoleUuid != null &&
this.RoleUuid.Equals(input.RoleUuid))
) &&
(
this.Role == input.Role ||
(this.Role != null &&
this.Role.Equals(input.Role))
);
}
/// <summary>
/// Gets the hash code
/// </summary>
/// <returns>Hash code</returns>
public override int GetHashCode()
{
unchecked // Overflow is fine, just wrap
{
int hashCode = 41;
if (this.RoleUuid != null)
{
hashCode = (hashCode * 59) + this.RoleUuid.GetHashCode();
}
if (this.Role != null)
{
hashCode = (hashCode * 59) + this.Role.GetHashCode();
}
return hashCode;
}
}
}
}

View File

@@ -0,0 +1,118 @@
/*
* OpenAPI Petstore
*
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
* Generated by: https://github.com/openapitools/openapi-generator.git
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
namespace Org.OpenAPITools.Model
{
/// <summary>
/// RolesReportsHashRole
/// </summary>
[DataContract(Name = "RolesReportsHash_role")]
public partial class RolesReportsHashRole : IEquatable<RolesReportsHashRole>
{
/// <summary>
/// Initializes a new instance of the <see cref="RolesReportsHashRole" /> class.
/// </summary>
/// <param name="name">name.</param>
public RolesReportsHashRole(string name = default(string))
{
this.Name = name;
}
/// <summary>
/// Gets or Sets Name
/// </summary>
[DataMember(Name = "name", EmitDefaultValue = false)]
public string Name { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append("class RolesReportsHashRole {\n");
sb.Append(" Name: ").Append(Name).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
}
/// <summary>
/// Returns true if objects are equal
/// </summary>
/// <param name="input">Object to be compared</param>
/// <returns>Boolean</returns>
public override bool Equals(object input)
{
return this.Equals(input as RolesReportsHashRole);
}
/// <summary>
/// Returns true if RolesReportsHashRole instances are equal
/// </summary>
/// <param name="input">Instance of RolesReportsHashRole to be compared</param>
/// <returns>Boolean</returns>
public bool Equals(RolesReportsHashRole input)
{
if (input == null)
{
return false;
}
return
(
this.Name == input.Name ||
(this.Name != null &&
this.Name.Equals(input.Name))
);
}
/// <summary>
/// Gets the hash code
/// </summary>
/// <returns>Hash code</returns>
public override int GetHashCode()
{
unchecked // Overflow is fine, just wrap
{
int hashCode = 41;
if (this.Name != null)
{
hashCode = (hashCode * 59) + this.Name.GetHashCode();
}
return hashCode;
}
}
}
}