mamift / LinqToXsdCore

LinqToXsd ported to .NET Core (targets .NET Standard 2 for generated code and .NET Core 3.1, .NET 5+ for the code generator CLI tool).
Microsoft Public License
41 stars 15 forks source link

Duplicate enums are not generated #31

Open auliere opened 3 years ago

auliere commented 3 years ago

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 commented 3 years ago

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.

mamift commented 3 years ago

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.

auliere commented 3 years ago

@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!!!

mamift commented 3 years ago

@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 commented 3 years ago

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

auliere commented 2 years ago

@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.