File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -454,18 +454,19 @@ public override CodeTypeDeclaration Generate()
454454 keyProperty . IsKey = true ;
455455 }
456456
457- foreach ( var property in Properties . GroupBy ( x => x . Name ) )
457+ foreach ( var property in Properties . GroupBy ( x => x . Name ) . Select ( g => g . Select ( ( p , i ) => ( Property : p , Index : i ) ) . ToList ( ) ) )
458458 {
459- var propertyIndex = 1 ;
460-
461- foreach ( var p in property )
462- {
463- if ( propertyIndex > 1 )
459+ foreach ( var p in property )
460+ {
461+ if ( p . Index > 0 )
464462 {
465- p . Name += $ "_{ propertyIndex } ";
463+ p . Property . Name += $ "_{ p . Index + 1 } ";
464+
465+ if ( property . Any ( q => p . Property . XmlSchemaName == q . Property . XmlSchemaName && q . Index < p . Index ) )
466+ continue ;
466467 }
467- p . AddMembersTo ( classDeclaration , Configuration . EnableDataBinding ) ;
468- propertyIndex ++ ;
468+
469+ p . Property . AddMembersTo ( classDeclaration , Configuration . EnableDataBinding ) ;
469470 }
470471 }
471472
You can’t perform that action at this time.
0 commit comments