HORK Sample: The Downwind database
This Sample HORK project is based on the Downwind database.
The plan is to use HORK to create entity classes from the Downwind database and then provide some samples of how you would use HORK in your application.
To create the Downwind database you will need SQL Server 2005 or later, any edition. Included with the HORK source code is the SQL script to create the database tables. Also included are the HORK xml model and generated entity classes from the Downwind database.
The Downwind database has the tables and relationships shown in the following diagram:
Its important to note the table relationships in this diagram, as they reflect how HORK will relate the tables as parents and children.
At the top-most level is the Contacts table. It has a primary key on ContactId. Addresses and Orders are related to Contacts by Foreign Keys with a one-to-many cardinality. With HORK, the Addresses and Orders tables are considered to be Child tables of Contacts.
OrderItems are related to Orders by Foreign Keys with a one-to-many cardinality, so OrderItems would be considered a Child table of Orders in HORK.
HORK will generate entity classes with the same parent-child relationships as those defined by the database foreign keys.