Skip to content

Commit

Permalink
Reverse IsRequired interface and class alignment (see #501)
Browse files Browse the repository at this point in the history
  • Loading branch information
mganss committed Apr 12, 2024
1 parent 59879d6 commit c33a385
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions XmlSchemaClassGenerator/ModelBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -237,16 +237,16 @@ private void PromoteInterfacePropertiesToCollection()
interfaceProperty.IsCollection = false;
}

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

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

0 comments on commit c33a385

Please sign in to comment.