You can create a new project using the Object Model Designer project template (its in C# Projects). The following image shows the project template for the Object Model Designer.

Each time you change your model, you have to regenerate the code (that represents that model) using the right-most button on the Solution Explorer or by selecting "Run Custom Tool" from the context menu of the MyModel.Designer.tt. This will generate the MyModel.Designer.cs file containing code for all classes in the model. The MyModel.cs is a demo implementation of how you would extend your model in code. All classes are generated as partial so you can regenerate your model anytime and might get compile errors for custom code that no longer 'connects' to the model code.
A MyModel.Designer.tt file is needed for every model (instance) you create in the project because the model is referenced in the .tt file. The actual .tt script is included from ObjectModelDesigner.tt.
You can download the installer for the Object Model Designer here.
0 comments:
Post a Comment