Skip to content

Commit be79661

Browse files
committed
Fix #543
1 parent 2659ead commit be79661

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

XmlSchemaClassGenerator/ModelBuilder.cs

+5-1
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ private static void RenameInterfacePropertyInBaseClasses(InterfaceModel interfac
260260
{
261261
foreach (var derivedClass in interfaceModel.AllDerivedReferenceTypes().Where(c => c != implementationClass))
262262
{
263-
foreach (var propertyModel in derivedClass.Properties.Where(p =>
263+
foreach (var propertyModel in derivedClass.Properties.Where(p =>
264264
implementationClassProperty.OriginalPropertyName == p.OriginalPropertyName
265265
&& implementationClassProperty.XmlSchemaName == p.XmlSchemaName
266266
&& implementationClassProperty.IsAttribute == p.IsAttribute))
@@ -526,7 +526,11 @@ private TypeModel CreateTypeModel(XmlSchemaComplexType complexType)
526526
var baseModel = builder.CreateTypeModel(complexType.BaseXmlSchemaType.QualifiedName, complexType.BaseXmlSchemaType);
527527
classModel.BaseClass = baseModel;
528528
if (baseModel is ClassModel baseClassModel)
529+
{
529530
baseClassModel.DerivedTypes.Add(classModel);
531+
if (classModel.AllBaseTypes.Any(b => b.XmlSchemaType.QualifiedName == qualifiedName))
532+
classModel.Name += "Redefinition";
533+
}
530534
}
531535

532536
XmlSchemaParticle xmlParticle = null;

0 commit comments

Comments
 (0)