Hello,
Using the latest version of LinqConnect, for some Enum-typed properties that a default value is specified, the generated code is falsely broken in 2 lines e.g. as follows:
private CompanySubtypeEnum _Subtype = (CompanySubtypeEnum)Enum.Parse(typeof(CompanySubtypeEnum), "1
");
First line goes up to and the rest goes to a second line that brakes the code.
Bug when generating code for the default value of an Enum
-
- Devart Team
- Posts: 1710
- Joined: Thu 03 Dec 2009 10:48
I know it's a bit odd, but it's true! And it is very annoying because i used to generate code in my project folder and now i switched back to generating the code to an other folder and copy only the entities that changed, because the number of broken files is too big to fix it by hand.
The template is the LinqConnect C#. I generate each entity per file. I don't know if this helps, and is a bit odd, but for a property that the default enum value is '0' everything works as expected! Only for the ones that the default value is '1' it brakes.
The template is the LinqConnect C#. I generate each entity per file. I don't know if this helps, and is a bit odd, but for a property that the default enum value is '0' everything works as expected! Only for the ones that the default value is '1' it brakes.
I found the cause of the bug. In the lqml xml file, the default value attribute was saved as :
DefaultValue="1
"
instead of DefaultValue="1". I don't know how this ended up in there! In the entity developer designer, the default value property looks correctly to be '1'. Maybe after the first Update Model from Database, when the new property or entire class is generated for the first time? It seems to be it. Anyway, i replaced all the aforementioned instances in the text file, and everything works ok now.
DefaultValue="1
"
instead of DefaultValue="1". I don't know how this ended up in there! In the entity developer designer, the default value property looks correctly to be '1'. Maybe after the first Update Model from Database, when the new property or entire class is generated for the first time? It seems to be it. Anyway, i replaced all the aforementioned instances in the text file, and everything works ok now.
-
- Devart Team
- Posts: 1710
- Joined: Thu 03 Dec 2009 10:48
-
- Devart Team
- Posts: 1710
- Joined: Thu 03 Dec 2009 10:48
The fix for this issue is available in the new 3.1.43 build of LinqConnect. The new build can be downloaded from
http://www.devart.com/linqconnect/download.html
(the trial version) or from Registered Users' Area (for users with active subscription only).
For more information about the fixes and improvements available in LinqConnect 3.1.43, please refer to
http://www.devart.com/forums/viewtopic.php?t=23468
http://www.devart.com/linqconnect/download.html
(the trial version) or from Registered Users' Area (for users with active subscription only).
For more information about the fixes and improvements available in LinqConnect 3.1.43, please refer to
http://www.devart.com/forums/viewtopic.php?t=23468