The metadata layer, generated as metadata.g.ts, contains a minimal set of metadata to represent your data model on the front-end. Because Vue applications are typically statically compiled, it is necessary for the frontend code to have a representation of your data model as an analog to the
ReflectionRepository available at runtime to Knockout apps that utilize .cshtml files.
The following is a non-exhaustive list of the general concepts used by the metadata layer. The source code of coalesce-vue provides the most exhaustive set of documentation about the metadata layer:
All objects in the metadata layer that represent any kind of metadata have, at the very least, a
name, the name of the metadata element in code (type names, property names, parameter names, etc). and a
displayName, the human-readable form of the name that is suitable for presentation when needed. Names follow the casing convention of their corresponding language elements - types are PascalCased, while other things like properties, methods, and parameters are camelCased.
All custom types exposed by your application's data model will have a Type metadata object generated. This includes both C# classes, and C# enums. Class types include
model (for EF Entity Models and Custom DTOs) and
object (for External Types).
In the metadata layer, a Value is the usage of a type. This could be any type - strings, numbers, enums, classes, or even void. Values can be found in the collection of an object's properties, a method's parameters or return value, or as a data source's parameters.
All values have a:
- Type could be a language primitive like
file), or in the case of a custom Type, the type kind of that type (
object). For custom types, an additional property
typeDefwill refer to the Type metadata for that type.
- Role represents what purpose the value serves in a relational model. Either value (the default - no relational role), primaryKey, foreignKey, referenceNavigation, or collectionNavigation.
A Property is a more refined Value that contains a number of additional fields based on the
role of the property. k