I’m generating C# classes from an XSD file using Liquid Studio 20.7.11. While the XSD elements are marked as nillable (nillable=”true”), the generated C# classes have the isNil flag set to false by default. I’ve tried setting the Lx-NillableDefaultValue property to true in my .csproj file, but it doesn’t seem to have any effect.
Example:
Consider the following XSD element:
<xs:element name="TestElement" type="xs:double" nillable="true"/>
The corresponding generated C# code includes the following property :
/// <summary>
/// A <see cref="System.Double" />, Required
/// </summary>
[LxElementValue(order: 0, elementName: "TestElement", elementNamespace: "", LxValueType.Value, XsdType.XsdDouble, MinOccurs = 1, MaxOccurs = 1)]
public LxNillable<System.Double> TestElement { get; set; } = LxNillable<System.Double>.Create(default(System.Double), isNil: false);
The LxNillable.Create() method is being used with isNil set to false, even though the corresponding XSD element is nillable.
Is there a known issue with nullable element handling in Liquid Studio 20.7.11? If so, are there any workarounds or alternative solutions to ensure that the isNil flag is set to true by default for nillable elements?
2