Skip to content

Commit 0a14101

Browse files
committed
Dotnet: Fix warnings
1 parent 8e93ad7 commit 0a14101

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

codegen/Templates/csharp/Project.mustache

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<PropertyGroup>
44
<TargetFrameworks>netstandard2.0</TargetFrameworks>
55
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
6+
<WarningsNotAsErrors>IDE0005;IDE0008;IDE1006</WarningsNotAsErrors>
67
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
78
<AnalysisLevel>latest-Recommended</AnalysisLevel>
89

codegen/Templates/csharp/api.mustache

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,8 @@ namespace {{packageName}}.Api
128128
null,
129129
{{#hasFormParams}}formParams{{/hasFormParams}}{{^hasFormParams}}null{{/hasFormParams}});
130130

131-
if (response != null)
132-
{
133-
return ({{returnType}}) SerializationHelper.Deserialize(response, typeof({{returnType}}));
134-
}
131+
return response == null ? null : ({{returnType}}) SerializationHelper.Deserialize(response, typeof({{returnType}}));
135132

136-
return null;
137133
{{/returnType}}
138134
{{^returnType}}
139135
await _apiInvoker.InvokeApiAsync(

0 commit comments

Comments
 (0)