nHydrate now supports MySql
This sample site demonstrates how to use a geneated API created with the nHydrate modeler platform.
It uses a MySql database as its backend.
All error checking and prompting is model based.
This site has very little code as the generated API and associated metadata defines almost all functionality.
You may use this site to learn how to use the Entity Framwork based API to add, edit, and delete data.
nHydrate MySql Sakila Sample
- Non-null fields are validated for existence
- Strings are validated for length
- Numbers are validated for type
- Email (for Customer/Staff entity) is validated against a regular expression
- Field labels are loaded from model and differ from field name
- Removing objects with dependencies shows error (remove pre-defined Category)
- Edit form controls are bound to entity objects of type 'BasePersistablePage'
- All binding is strongly-typed with no 'Magic strings'
- Validation is model based
- Field prompts are model based
This sample site has not been fully developed. You cannot add and delete on every screen.
If you wish to add or delete data, use the Categories Screen.
This list screen has an Add button for creating new items.
Each item in the list has a Delete link to remove individual items.
This example was written against the Entity Framework DAL (data access layer).
The connection string is setup in the "Web.config" file.
All of the queries can use LINQ directly against the DAL.
Using the DAL is easiest way to perform dependecy walking operations.
You simply call the property for a related object or list from any other object.
Notice that some objects have other object lists or items to related objects.
For example, the Customer object has an RentalList property because of its relation.
An Rental object has a back pointer to its parent Customer object.
You can download this sample from CodePlex. It does require nHydrate to be installed in order to open the model.