Skip to content

Inferred Model Viewer

Simon Mourier edited this page Feb 19, 2020 · 1 revision

The Inferred Model View is a tool that allows you to have a look at the in-memory model that CodeModeler builds before anything gets ever generated.

There are lots of differences between the model you see when you modify it using Visual Studio and an instance of the in-memory inferred model. For example, tracking properties in generated tables (LastWriteTime, etc.), or aspects (like the Localization Aspect) are disabled when you edit the model. Viewing the inferred model allows you to see everything that is computed before it will get generated, which saves considerable amount of times.

When you click on “View Inferred Model” in the project Ribbon Bar, CodeModeler will first infer the model (and display a progress bar which can take some times if the model is complex) and will then present a resizable dialog box like this one:

Inferred Model Viewer - Picture 97

The upper left tree view displays all manually modeled concepts (entity, enumeration, property, method, etc.) but also inferred concepts such as virtual tables and columns. Here we have selected one virtual column and we can check its characteristics with the upper right property grid.

Note: Although it looks like the property grid is editable, changing anything in there will have no effect on the model being edited in Visual Studio.

In the lower part of the dialog box, we may see errors that CodeModeler has detected in the current model, if there are any. Clicking on the error item will move the tree view to the related concept in error.

Note, we can also have a preview at stored procedures bodies:

Inferred Model Viewer - Picture 98

The language here is not SQL, it’s CodeModeler’s SQLDom, an intermediate representation of SQL (here output as a string) that CodeModeler uses to represent stored procedure. Each persistence producer will convert this SQLDom representation (an Abstract Syntax Tree, or “AST”) into real target SQL (like T-SQL for SQL Server, etc.).

Clone this wiki locally