“Horking

 

Determine HORK Entity properties

The HORKTemplateGenerator will generate entity classes to match the tables and columns found in the database.
The entity classes are output to a path specified at run-time, and will utilize the user-specified namespace.

To show how the HORKTemplateGenerator works with your specified path and namespace, lets see a working example in action.

There is a WPF application named WPFWidget that will be using HORK for its data access. WPFWidget uses the primary namespace Company.Apps.WPFWidget.
The VisualStudio project for WPFWidget is located in the path D:\vsProjects\WPFWidget. It has been decided that the namespace for the HORK entities will be Company.Apps.WPFWidget.DataAccessObjects.
To complement the new namespace, the directory D:\vsProjects\WPFWidget\DataAccessObjects has been created.
To create the generated entity classes into the correct directory with the correct namespace, the following values should be used to launch HORKTemplateGenerator:

With these settings, the HORKTemplateGenerator will generate the entity classes right into the VisualStudio project directory with the expected namespace.

In this image we can see the WPFWidget\DataAccessObjects directory with the generated entity classes in the Entities and Loaders directories:

Note that the DataAccessObjects directory also contains the HORKOUT.xml file. This file is an XML representation of the data model which was generated from your database.
The data model file can be used when you want to make changes to the database, but do not want to re-run the HORKTemplateGenerator against a database. For example, after generating your entity classes with HORKTemplateGenerator you may decide to add a column to one table. The database can be changed by running a single ALTER TABLE query, and the HORKOUT.XML file can be edited and have the column added through the XML model.
The HORKOUT.xml data model can also be used to keep versions of your data model in a source code control system. If you update the model file as you make database changes, you will end up with a history of changes over time.
HORK does not support changing the XML model to cause table changes in the database. That is, if you change the XML model you need to make the same change in the database or you could have errors at run time.