LinqToXsdCore icon indicating copy to clipboard operation
LinqToXsdCore copied to clipboard

Duplicate enums are not generated

Open auliere opened this issue 4 years ago • 6 comments

There are a couple of bugs related to enum generation.

  1. When you have two anonymous enum types defined for attributes within different complex types, the enum only generates for a single one of these comples types (see the example in the attachment) SimpleSchema.zip

  2. When you have two anonymous enum types defined for elements within different complex types, the enum is not generated at all (please see the example in the attachment) SimpleSchemaElement.zip

auliere avatar Jun 08 '21 16:06 auliere

For issue 1 - Looks like it is partially done on purpose:

https://github.com/mamift/LinqToXsdCore/blob/d6dbc2ff801e2fe4561ea140c197983fd6014735/XObjectsCode/Src/TypesToCodeDom.cs#L238-L240

After commenting this check for duplicates my SampleSchema produces a valid c# file.

auliere avatar Jun 08 '21 21:06 auliere

Hello,

Yes I'm aware of the issue; I've been trying to properly diagnose & fix the issue in the multipleEnumFix branch, but due to time constraints haven't been able to get to the root cause.

mamift avatar Jun 09 '21 00:06 mamift

@mamift - I see that your most recent commit to master branch has fixed this issue. Do you know when you plan to release this version so that it can be used without building the tool from the sources?

Thank you very much for actively supporting this tool! It is very much appreciated!!!

auliere avatar Jul 01 '21 08:07 auliere

@mamift - I see that your most recent commit to master branch has fixed this issue. Do you know when you plan to release this version so that it can be used without building the tool from the sources?

Yes I do intend to do that; I'll see if I can get around to it this coming weekend.

mamift avatar Jul 01 '21 21:07 mamift

@auliere New release should be publicly visible shortly: https://www.nuget.org/packages/LinqToXsdCore/3.2.1

mamift avatar Jul 03 '21 07:07 mamift

@mamift Thank you very much for the fix and a prompt release! Works nice and helps us to get the job done!

Looks like problem 2 still persists though - but I didn't encounter any problems with it for now in my real projects.

auliere avatar Jul 07 '21 20:07 auliere