yasser777 / nettiers

Automatically exported from code.google.com/p/nettiers
0 stars 0 forks source link

Enhancement: Sorted functions/etc/within generated code #345

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
(I couldn't find how to add an enhancement request, so I did it here.  Sorry!)

I was digging around inside of netTiers, and couldn't figure out if this is 
possible, but here is my request:

In the *.generated.cs files, it groups all the functions, etc, into regions, 
such as "#region GetByForeignKey" and "#region GetById", etc.  Is it possible 
to have nettiers alphabetically sort these functions before the code is 
generated?  

Right now, if I generate code from a database, store that code in source 
control, modify that table and regenerate, and check in again, I get a lot of 
modified files, and some are just re-arranged functions.  

If they were sorted, it would make version comparisons a lot easier :)

Like I said, this is not a bug, because the code is not really changing, but it 
would make versioning easier.  Thanks for the great project!

Original issue reported on code.google.com by mikiur...@gmail.com on 22 Sep 2010 at 4:08

GoogleCodeExporter commented 9 years ago
I would agree with this. Sorting alphabetically would be a good thing.

Original comment by bh...@questis.com on 22 Sep 2010 at 1:20

GoogleCodeExporter commented 9 years ago
Hello,

What version of CodeSmith are you two using? CodeSmith 5.x automatically sorts 
all of the SchemaExplorer results and so this shouldn't be an issue.

Thanks
-Blake Niemyjski

Original comment by bniemyjski on 22 Sep 2010 at 9:36

GoogleCodeExporter commented 9 years ago
I was basing my comment off what I had observed long ago when 1st working with 
NetTiers/CodeSmith... I haven't checked recently but I'm using the latest 5.x 

Original comment by bh...@questis.com on 24 Sep 2010 at 2:21

GoogleCodeExporter commented 9 years ago
Hello,

Please let me know what you find as this should be resolved.

Thanks
-Blake Niemyjski

Original comment by bniemyjski on 24 Sep 2010 at 3:39

GoogleCodeExporter commented 9 years ago
After a lot of testing (nettiers 2.3.0r850 and Codesmith 5.1.3r8510), I figured 
out the problem (and I think there are actually 2).

When Codesmith loads a project, the "SourceTables" field lists the selected 
tables in the order they appear in .csp project file (it doesn't automatically 
sort them at load).  If I click the "..." button to show the list of tables and 
click "Select", the list of tables will become sorted, even if I didn't add or 
remove any.  The generated output will now be different than if I clicked 
"generate" immediately after the project loads. 

The 2nd problem is the Mapping.Config file that is created. The 
<ChildCollection> objects are not sorted by their "Id" attributes, so adding or 
removing a table that has foreign keys can rearrange this <ChildCollection> 
order, and will affect some generated code files.

I am not sure if the 2nd problem can be fixed in nettiers or codesmith, so I'm 
not sure if this issue can be closed or not.

Original comment by mikiur...@gmail.com on 24 Sep 2010 at 7:01

GoogleCodeExporter commented 9 years ago
Also, this issue may need to be renamed (if it doesn't get closed)

Original comment by mikiur...@gmail.com on 24 Sep 2010 at 7:01