Commit 4b89ec3 Michael Ganss
committed
1 parent 7576f89 commit 4b89ec3 Copy full SHA for 4b89ec3
File tree 1 file changed +10
-9
lines changed
1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -454,18 +454,19 @@ public override CodeTypeDeclaration Generate()
454
454
keyProperty . IsKey = true ;
455
455
}
456
456
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 ( ) ) )
458
458
{
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 )
464
462
{
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 ;
466
467
}
467
- p . AddMembersTo ( classDeclaration , Configuration . EnableDataBinding ) ;
468
- propertyIndex ++ ;
468
+
469
+ p . Property . AddMembersTo ( classDeclaration , Configuration . EnableDataBinding ) ;
469
470
}
470
471
}
471
472
You can’t perform that action at this time.
0 commit comments