tvoss wrote:
I was wondering if the one-click regeneration ever got there as I have been too busy to check in as often as I'd like.
Well, the unattended refresh is in, (will come in the upgrade going beta next week), re-generating code is still F7 -> enter, or use the command line generator.
Also, did you see the article in the last Code Magazine issue by Dino Esposito, mentioning the value of partial classes for data access layers for extending the generated code versus using inheritance. What do you think of the idea?
I haven't read the article, as I don't have the magazine, but knowing Esposito I think I know what he said .
Partial classes are great for code generators, and when they arrive I'll definitely use them. It indeed solves the problem of needing to create a derived class for adding behavior, when deriving the class also gives problems in the related entity department: Order has a reference of type 'Customer'. If I derive a class MyCustomer from Customer, I also have to change Order, as it initially holds a reference to Customer, not MyCustomer.
Partial classes aren't the solution for everything though: you don't have partial methods. This means that if I generate an initialization routine for an entity, and you want to set a ConcurrencyPredicateFactory instance in there, you still have to alter the generated code in some way, as the initialization routine is not adjustable using a method in another part of the class.
Coming with the upgrade I've created a feature called User Code Regions. In the template, there are regions marked which are emitted with markers into the generated code. The user can then add code between these markers in the generated code and this code is preserved between code generation cycles. I'll continue using that in .NET 2.0 to also give users the oppertunity to alter initialization routines for example, or adding extra interfaces to the class header, to name a few places where this can be helpful