The templates I am using came from this folder:
I am using the version from the beginning of December 2010.
C:\Program Files\Telerik\OpenAccess ORM\dsl2010\CodeGenerationTemplates\CSharp
I copied them to my project, and modified the OA file to point to these new templates. (and changed the paths in the templates themselves to point to this folder). I did have to add the "this." to the private variables.
What I am trying to accomplish:
I am using an undo redo framework called DejaVu, which requires the backing variables to be wrapped in a generic "UndoRedo<int> privatevar". These need to be default set up to a "new UndoRedo<int>(defaultvalue)". If I make any modification to the naming scheme of the privatevar, OA crashes on code injection, because it looks for the actual column name instead of the private variable name. I tried wrapping the private var up in property (trying to trick OA into using it as a regular variable), but it didnt like that either. (On a related note, this would be a great new product for you to release "RadUndo"
. A simple to use undo redo framework, that integrates with OA.)
I ended up throwing out OA (again) and going back to Linq2Sql, using T4 toolbox. It pretty much let me do all I wanted, even tho it injects code like OA does, it seems to be a little smarter about it. I can rename private variables and L2S seems to figure out that I renamed them, and use the undo redo framework L2S knows how to initialize the private variables. The only problem I have with L2S is switching between SQLCE and SQL server (OA was simpler in that regard).
// when I wrap the private var, OA complains about deviceName not being a string on code injection
// I also tried to make two private variables, and syncing them but still ended up with the problem of
// getting the value in the first place into undo object.
> deviceName =
deviceName.Value = value;