Appendix C. Additional Details About Entity Data Model Metadata

In Chapter 2, you created your first Entity Data Model and inspected it in the Entity Data Model Designer as well as looking at the raw XML.

There are some portions of the metadata that you might never need to work with and they were not included in that chapter. Those details are listed in this appendix in case you have a need for them.

Seeing EDMX Schema Validation in Action

The EDMX file leverages schema files for validation. To see a schema’s rules in action, try editing the XML manually. For example, start entering a new <Property> element inside the Address EntityType. IntelliSense will provide a list of options within the property. Alternatively, you can intentionally break something! For example, change the spelling of an element name—perhaps change EntityType to ElephantType. The XML will provide visual clues to indicate that something is amiss, and the Errors List will list warnings regarding any invalid elements. Don’t forget to undo these changes!

Additional Conceptual Model Details

Schema

The outer element, Schema, defines the name of the entire model’s namespace, which in this case is SampleModel. The namespace is defined by default to have the name of the database from which the model is derived, plus the word Model. The schema also defines an Alias, which by default is Self. This is just a nickname for the model and you can name it anything you like. There is also an xmlns namespace URI, which defines the ...

Get Programming Entity Framework, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.