From 544994fe5ecb6b264420dd8f099a39a0abac7ded Mon Sep 17 00:00:00 2001 From: Michael Ganss Date: Tue, 23 Aug 2022 19:34:45 +0200 Subject: [PATCH] Fix #350 --- .../xsd/simple/ng.xsd | 21 +++++++++++++++++++ XmlSchemaClassGenerator/TypeModel.cs | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 XmlSchemaClassGenerator.Tests/xsd/simple/ng.xsd diff --git a/XmlSchemaClassGenerator.Tests/xsd/simple/ng.xsd b/XmlSchemaClassGenerator.Tests/xsd/simple/ng.xsd new file mode 100644 index 00000000..e011e3f5 --- /dev/null +++ b/XmlSchemaClassGenerator.Tests/xsd/simple/ng.xsd @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + diff --git a/XmlSchemaClassGenerator/TypeModel.cs b/XmlSchemaClassGenerator/TypeModel.cs index cfbae63d..92a7fbf5 100644 --- a/XmlSchemaClassGenerator/TypeModel.cs +++ b/XmlSchemaClassGenerator/TypeModel.cs @@ -664,7 +664,7 @@ public void AddInterfaceMembersTo(CodeTypeDeclaration typeDeclaration) var isPrivateSetter = IsPrivateSetter; var typeReference = TypeReference; - if (isNullableValueType && Configuration.GenerateNullables) + if ((isNullableValueType || IsNillableValueType) && Configuration.GenerateNullables) typeReference = NullableTypeRef(typeReference); member = new CodeMemberProperty