|So, I've been working on this app that will generate model and viewmodel classes from stored procs in the specified database. It's intended for folks like me, that abhor the thought of using a UDM, or that find the ADO.Net project in Visual Studio to the quagmire of failure that it is.
Every time I think I've reached a point where I think I'm finally done, I think of something else that really must be included in the app.
0) It would be nice if I could do the same thing with tables and views. Result : a new wizard page, a new window, and a crapload of refactoring in the code generator. Thought I was finally done...
1) I decided to try out the long-ignored stored proc generator. Result: new window to handle procs with input parameters, and fixing some generator code. Thought I was finally done...
2) I decided I wanted to add more flexibility where the viewmodel generation was concerned. Result: Completely refactoring the settings wizard page, adding a help window for viewmodel settings, and adding code to react to the new settings. Thought I was finally done...
3) Item #3 is boycotted today. This item will not appear in any of my enumerated lists for the remainder of the day.
4) It might be nice to add properties that provide CRUD queries for tables. Result : adding code to the code generator that does creates the queries, and adding a number of new app settings to allow some flexibility. Thought I was finally done...
5) In the process of adding the CRUD stuff, a dilemma arose regarding how to identify the column that would control update and delete functionality. Originally, I looked for a column with the text "ID" in it. I sat there looking at the code, and thought, "Not everybody is as pragmatic as I am in their column naming habits, so I, after a little research, I discovered that the ADO
DataColumn object contained properties to help you find columns that auto-increment and that are read-only. So, I changed the code to retain and look for those properties to identify the most likely ID column. The whole detection code block turned into a three-tier setup, where I look for the autoincrement/readonly column, fall back to one that looks for "ID" in the name, and then finally, simply use the first column in the returned schema.
Unless you count testing, testing, and more testing, and then writing the actual article series, I think I'm finally done...
Famous last words, right?
".45 ACP - because shooting twice is just silly" - JSOP, 2010
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
modified 4-May-20 10:08am.