THRIFT-5511 Full support for the new net6 "nullability" semantics
Client: netstd
Patch: Jens Geyer

This closes #2516
diff --git a/lib/netstd/Tests/Thrift.PublicInterfaces.Compile.Tests/Impl/Thrift5253/MyService.cs b/lib/netstd/Tests/Thrift.PublicInterfaces.Compile.Tests/Impl/Thrift5253/MyService.cs
index 660b2b7..f423376 100644
--- a/lib/netstd/Tests/Thrift.PublicInterfaces.Compile.Tests/Impl/Thrift5253/MyService.cs
+++ b/lib/netstd/Tests/Thrift.PublicInterfaces.Compile.Tests/Impl/Thrift5253/MyService.cs
@@ -26,30 +26,30 @@
 {
     class MyServiceImpl : MyService.IAsync
     {
-        public Task<AsyncProcessor> AsyncProcessor_(AsyncProcessor input, CancellationToken cancellationToken = default)
+        public Task<AsyncProcessor> AsyncProcessor_(AsyncProcessor? input, CancellationToken cancellationToken = default)
         {
-            return Task.FromResult(new AsyncProcessor() { Foo = input.Foo });
+            return Task.FromResult(new AsyncProcessor() { Foo = input?.Foo ?? 0 });
         }
 
-        public Task<BrokenResult> Broken(BrokenArgs input, CancellationToken cancellationToken = default)
+        public Task<BrokenResult> Broken(BrokenArgs? input, CancellationToken cancellationToken = default)
         {
-            return Task.FromResult(new BrokenResult() { Foo = input.Foo });
+            return Task.FromResult(new BrokenResult() { Foo = input?.Foo ?? 0 });
         }
 
-        public Task<Client> Client_(Client input, CancellationToken cancellationToken = default)
+        public Task<Client> Client_(Client? input, CancellationToken cancellationToken = default)
         {
             _ = cancellationToken;
-            return Task.FromResult(new Client() { Foo = input.Foo });
+            return Task.FromResult(new Client() { Foo = input?.Foo ?? 0 });
         }
 
-        public Task<IAsync> IAsync_(IAsync input, CancellationToken cancellationToken = default)
+        public Task<IAsync> IAsync_(IAsync? input, CancellationToken cancellationToken = default)
         {
-            return Task.FromResult(new IAsync() { Foo = input.Foo });
+            return Task.FromResult(new IAsync() { Foo = input?.Foo ?? 0 });
         }
 
-        public Task<InternalStructs> InternalStructs_(InternalStructs input, CancellationToken cancellationToken = default)
+        public Task<InternalStructs> InternalStructs_(InternalStructs? input, CancellationToken cancellationToken = default)
         {
-            return Task.FromResult(new InternalStructs() { Foo = input.Foo });
+            return Task.FromResult(new InternalStructs() { Foo = input?.Foo ?? 0 });
         }
 
         public Task TestAsync(CancellationToken cancellationToken = default)
@@ -62,9 +62,9 @@
             return Task.CompletedTask;
         }
 
-        public Task<WorksRslt> Works(WorksArrrgs input, CancellationToken cancellationToken = default)
+        public Task<WorksRslt> Works(WorksArrrgs? input, CancellationToken cancellationToken = default)
         {
-            return Task.FromResult(new WorksRslt() { Foo = input.Foo });
+            return Task.FromResult(new WorksRslt() { Foo = input?.Foo ?? 0 });
         }
     }
 }
diff --git a/lib/netstd/Tests/Thrift.PublicInterfaces.Compile.Tests/Thrift.PublicInterfaces.Compile.Tests.csproj b/lib/netstd/Tests/Thrift.PublicInterfaces.Compile.Tests/Thrift.PublicInterfaces.Compile.Tests.csproj
index 176e734..42a139c 100644
--- a/lib/netstd/Tests/Thrift.PublicInterfaces.Compile.Tests/Thrift.PublicInterfaces.Compile.Tests.csproj
+++ b/lib/netstd/Tests/Thrift.PublicInterfaces.Compile.Tests/Thrift.PublicInterfaces.Compile.Tests.csproj
@@ -68,14 +68,14 @@
     <Error Condition="$('$(ThriftBinaryVersion)'::StartsWith('$(ThriftVersionOutput)')) == true" Text="Thrift version returned: '$(ThriftBinaryVersion)' is not equal to the projects version '$(ThriftVersionOutput)'." />
     <Message Importance="high" Text="Generating tests with thrift binary: '$(PathToThrift)'" />
     <!-- Generate the thrift test files -->
-    <Exec Command="$(PathToThrift) -gen netstd:wcf,union,serial -r ./CassandraTest.thrift" />
-    <Exec Command="$(PathToThrift) -gen netstd:wcf,union,serial -r ./optional_required_default.thrift" />
-    <Exec Command="$(PathToThrift) -gen netstd:wcf,union,serial -r ./name_conflicts.thrift" />
-    <Exec Command="$(PathToThrift) -gen netstd:wcf,union,serial -r ./../../../../test/ThriftTest.thrift" />
-    <Exec Command="$(PathToThrift) -gen netstd:wcf,union,serial -r ./../../../../contrib/fb303/if/fb303.thrift" />
-    <Exec Command="$(PathToThrift) -gen netstd:wcf,union,serial -r ./Thrift5253.thrift" />
-    <Exec Command="$(PathToThrift) -gen netstd:wcf,union,serial -r ./Thrift5320.thrift" />
-    <Exec Command="$(PathToThrift) -gen netstd:wcf,union,serial -r ./Thrift5382.thrift" />
+    <Exec Command="$(PathToThrift) -gen netstd:wcf,union,serial,net6 -r ./CassandraTest.thrift" />
+    <Exec Command="$(PathToThrift) -gen netstd:wcf,union,serial,net6 -r ./optional_required_default.thrift" />
+    <Exec Command="$(PathToThrift) -gen netstd:wcf,union,serial,net6 -r ./name_conflicts.thrift" />
+    <Exec Command="$(PathToThrift) -gen netstd:wcf,union,serial,net6 -r ./../../../../test/ThriftTest.thrift" />
+    <Exec Command="$(PathToThrift) -gen netstd:wcf,union,serial,net6 -r ./../../../../contrib/fb303/if/fb303.thrift" />
+    <Exec Command="$(PathToThrift) -gen netstd:wcf,union,serial,net6 -r ./Thrift5253.thrift" />
+    <Exec Command="$(PathToThrift) -gen netstd:wcf,union,serial,net6 -r ./Thrift5320.thrift" />
+    <Exec Command="$(PathToThrift) -gen netstd:wcf,union,serial,net6 -r ./Thrift5382.thrift" />
   </Target>
 
 </Project>