[C#][netcore] minor code improvement (#10951)

* minor code improvement

* better code format
This commit is contained in:
William Cheng
2021-11-25 13:28:33 +08:00
committed by GitHub
parent 2e47f3e84c
commit 1953e70661
417 changed files with 9873 additions and 3788 deletions

View File

@@ -321,14 +321,21 @@ namespace Org.OpenAPITools.Api
};
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
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);
if (localVarAccept != null)
{
localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
}
if (files != null)
{
foreach (var file in files) {
foreach (var file in files)
{
localVarRequestOptions.FileParameters.Add("files", file);
}
}
@@ -336,11 +343,13 @@ namespace Org.OpenAPITools.Api
// make the HTTP request
var localVarResponse = this.Client.Post<Object>("/multipart-array", localVarRequestOptions, this.Configuration);
if (this.ExceptionFactory != null)
{
Exception _exception = this.ExceptionFactory("MultipartArray", localVarResponse);
if (_exception != null) throw _exception;
if (_exception != null)
{
throw _exception;
}
}
return localVarResponse;
@@ -378,29 +387,37 @@ namespace Org.OpenAPITools.Api
string[] _accepts = new string[] {
};
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
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);
if (localVarAccept != null)
{
localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
}
if (files != null)
{
foreach (var file in files) {
foreach (var file in files)
{
localVarRequestOptions.FileParameters.Add("files", file);
}
}
// make the HTTP request
var localVarResponse = await this.AsynchronousClient.PostAsync<Object>("/multipart-array", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false);
if (this.ExceptionFactory != null)
{
Exception _exception = this.ExceptionFactory("MultipartArray", localVarResponse);
if (_exception != null) throw _exception;
if (_exception != null)
{
throw _exception;
}
}
return localVarResponse;
@@ -429,7 +446,9 @@ namespace Org.OpenAPITools.Api
{
// verify the required parameter 'file' is set
if (file == null)
{
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'file' when calling MultipartApi->MultipartMixed");
}
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
@@ -442,10 +461,16 @@ namespace Org.OpenAPITools.Api
};
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
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);
if (localVarAccept != null)
{
localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
}
if (marker != null)
{
@@ -456,11 +481,13 @@ namespace Org.OpenAPITools.Api
// make the HTTP request
var localVarResponse = this.Client.Post<Object>("/multipart-mixed", localVarRequestOptions, this.Configuration);
if (this.ExceptionFactory != null)
{
Exception _exception = this.ExceptionFactory("MultipartMixed", localVarResponse);
if (_exception != null) throw _exception;
if (_exception != null)
{
throw _exception;
}
}
return localVarResponse;
@@ -491,7 +518,9 @@ namespace Org.OpenAPITools.Api
{
// verify the required parameter 'file' is set
if (file == null)
{
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'file' when calling MultipartApi->MultipartMixed");
}
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
@@ -504,12 +533,17 @@ namespace Org.OpenAPITools.Api
string[] _accepts = new string[] {
};
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
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);
if (localVarAccept != null)
{
localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
}
if (marker != null)
{
@@ -519,13 +553,15 @@ namespace Org.OpenAPITools.Api
// make the HTTP request
var localVarResponse = await this.AsynchronousClient.PostAsync<Object>("/multipart-mixed", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false);
if (this.ExceptionFactory != null)
{
Exception _exception = this.ExceptionFactory("MultipartMixed", localVarResponse);
if (_exception != null) throw _exception;
if (_exception != null)
{
throw _exception;
}
}
return localVarResponse;
@@ -561,10 +597,16 @@ namespace Org.OpenAPITools.Api
};
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
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);
if (localVarAccept != null)
{
localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
}
if (file != null)
{
@@ -574,11 +616,13 @@ namespace Org.OpenAPITools.Api
// make the HTTP request
var localVarResponse = this.Client.Post<Object>("/multipart-single", localVarRequestOptions, this.Configuration);
if (this.ExceptionFactory != null)
{
Exception _exception = this.ExceptionFactory("MultipartSingle", localVarResponse);
if (_exception != null) throw _exception;
if (_exception != null)
{
throw _exception;
}
}
return localVarResponse;
@@ -616,12 +660,17 @@ namespace Org.OpenAPITools.Api
string[] _accepts = new string[] {
};
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
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);
if (localVarAccept != null)
{
localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
}
if (file != null)
{
@@ -630,13 +679,15 @@ namespace Org.OpenAPITools.Api
// make the HTTP request
var localVarResponse = await this.AsynchronousClient.PostAsync<Object>("/multipart-single", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false);
if (this.ExceptionFactory != null)
{
Exception _exception = this.ExceptionFactory("MultipartSingle", localVarResponse);
if (_exception != null) throw _exception;
if (_exception != null)
{
throw _exception;
}
}
return localVarResponse;

View File

@@ -54,7 +54,7 @@ namespace Org.OpenAPITools.Model
/// <returns>String presentation of the object</returns>
public override string ToString()
{
var sb = new StringBuilder();
StringBuilder sb = new StringBuilder();
sb.Append("class InlineObject {\n");
sb.Append(" Files: ").Append(Files).Append("\n");
sb.Append("}\n");
@@ -100,7 +100,9 @@ namespace Org.OpenAPITools.Model
{
int hashCode = 41;
if (this.Files != null)
hashCode = hashCode * 59 + this.Files.GetHashCode();
{
hashCode = (hashCode * 59) + this.Files.GetHashCode();
}
return hashCode;
}
}

View File

@@ -54,7 +54,7 @@ namespace Org.OpenAPITools.Model
/// <returns>String presentation of the object</returns>
public override string ToString()
{
var sb = new StringBuilder();
StringBuilder sb = new StringBuilder();
sb.Append("class InlineObject1 {\n");
sb.Append(" File: ").Append(File).Append("\n");
sb.Append("}\n");
@@ -100,7 +100,9 @@ namespace Org.OpenAPITools.Model
{
int hashCode = 41;
if (this.File != null)
hashCode = hashCode * 59 + this.File.GetHashCode();
{
hashCode = (hashCode * 59) + this.File.GetHashCode();
}
return hashCode;
}
}

View File

@@ -71,7 +71,7 @@ namespace Org.OpenAPITools.Model
/// <returns>String presentation of the object</returns>
public override string ToString()
{
var sb = new StringBuilder();
StringBuilder sb = new StringBuilder();
sb.Append("class InlineObject2 {\n");
sb.Append(" Marker: ").Append(Marker).Append("\n");
sb.Append(" File: ").Append(File).Append("\n");
@@ -118,9 +118,13 @@ namespace Org.OpenAPITools.Model
{
int hashCode = 41;
if (this.Marker != null)
hashCode = hashCode * 59 + this.Marker.GetHashCode();
{
hashCode = (hashCode * 59) + this.Marker.GetHashCode();
}
if (this.File != null)
hashCode = hashCode * 59 + this.File.GetHashCode();
{
hashCode = (hashCode * 59) + this.File.GetHashCode();
}
return hashCode;
}
}

View File

@@ -53,7 +53,7 @@ namespace Org.OpenAPITools.Model
/// <returns>String presentation of the object</returns>
public override string ToString()
{
var sb = new StringBuilder();
StringBuilder sb = new StringBuilder();
sb.Append("class MultipartMixedMarker {\n");
sb.Append(" Name: ").Append(Name).Append("\n");
sb.Append("}\n");
@@ -99,7 +99,9 @@ namespace Org.OpenAPITools.Model
{
int hashCode = 41;
if (this.Name != null)
hashCode = hashCode * 59 + this.Name.GetHashCode();
{
hashCode = (hashCode * 59) + this.Name.GetHashCode();
}
return hashCode;
}
}