[csharp][httpclient] Fix accidental use of c# 8 language feature (#9037)

* Fix c# 8 language feature being present

* Change config to refer to netstandard 2.0

* Update samples
This commit is contained in:
Blackclaws 2021-03-23 17:33:13 +01:00 committed by GitHub
parent d438d797da
commit 0f981fffc3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 4 deletions

View File

@ -9,4 +9,4 @@ additionalProperties:
useCompareNetObjects: true
disallowAdditionalPropertiesIfNotPresent: false
useOneOfDiscriminatorLookup: true
targetFramework: netstandard2.1
targetFramework: netstandard2.0

View File

@ -319,7 +319,7 @@ namespace {{packageName}}.Client
{
if (options.Data is Stream s)
{
contentType ??= "application/octet-stream";
contentType = contentType ?? "application/octet-stream";
var streamContent = new StreamContent(s);
streamContent.Headers.ContentType = new MediaTypeHeaderValue(contentType);

View File

@ -305,7 +305,7 @@ namespace Org.OpenAPITools.Client
{
if (options.Data is Stream s)
{
contentType ??= "application/octet-stream";
contentType = contentType ?? "application/octet-stream";
var streamContent = new StreamContent(s);
streamContent.Headers.ContentType = new MediaTypeHeaderValue(contentType);

View File

@ -2,7 +2,7 @@
<PropertyGroup>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<TargetFramework>netstandard2.1</TargetFramework>
<TargetFramework>netstandard2.0</TargetFramework>
<AssemblyName>Org.OpenAPITools</AssemblyName>
<PackageId>Org.OpenAPITools</PackageId>
<OutputType>Library</OutputType>