Skip to content

Commit

Permalink
Align interface and class property definitions (fixes #501)
Browse files Browse the repository at this point in the history
  • Loading branch information
mganss committed Apr 12, 2024
1 parent b40fbdb commit 59879d6
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions XmlSchemaClassGenerator/ModelBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,22 @@ private void PromoteInterfacePropertiesToCollection()

interfaceProperty.IsCollection = true;
}
else
{
interfaceProperty.IsCollection = false;
}

if (derivedProperties.Exists(p => p.IsRequired))
{
foreach (var derivedProperty in derivedProperties.Where(p => !p.IsRequired))
derivedProperty.IsRequired = true;

interfaceProperty.IsRequired = true;
}
else
{
interfaceProperty.IsRequired = false;
}
}
}
}
Expand Down

0 comments on commit 59879d6

Please sign in to comment.