LLBLGen Pro contains a deep, multi-stage project validation system. This system runs in the background in the designer and is executed every time a change is made to the project (with a small delay). You can also start it manually by using Project -> Validate or by clicking the button to immediately Validate the project.
The following validations are performed in LLBLGen Pro:
- Model and Mapping Validation. This is the first stage and this validation makes sure that every element in the model is valid by itself and that every element in the model has a valid mapping. If an error is detected in one of the elements in the model or in the mappings, it is send to the UI as an error.
- Entity Model Target Framework Validation. When the Model and Mapping Validation stage doesn't find any errors, the Framework Validator assembly of the Entity Model target framework is invoked to validate the project. Each target framework has its own Framework Validator assembly, and these assemblies are in charge to catch any feature / project element which isn't supported by the chosen target Framework.
- Derived Models Validation. This is the stage where each Derived Model is validated. It validates both the models themselves and also uses the Framework Validator assembly of the Derived Model target framework used by a Derived Model. This validation is performed regardless of whether the other stages result in an error or not.
When an error or warning is detected during validation, it throws it upwards, and it ends up in the Errors & Warnings pane, which is a pane docked at the bottom of the LLBLGen Pro designer. The error or warning is also logged as text in the Application Output pane which is also docked at the bottom of the LLBLGen Pro designer.
Errors in the Errors & Warnings Pane
LLBLGen Pro tries to attach to each warning or error one or more suggestions or actions. You can view the suggestions or actions for each error by expanding the error in the Errors & Warnings pane. If the error or warning has one or more suggestions, they describe what you can do to solve the error.
If the error or warning has one or more action choices you can take, each of them will contain a link you can click to either go to the particular editor and load the element and correct the error manually, or if applicable, you can click the link to correct the error directly. It depends on the error which corrections/actions are given.
It can sometimes be convenient to ignore a given warning as it would otherwise clutter the rest of the warnings you want to pay attention to. The designer makes it possible to ignore warnings (and unignore them) in the Errors & Warnings pane. Each warning has an ID, which is a simple code: ABxxxx. AB are two alphanumeric characters which represent the origin of the warning and xxxx is the number of the warning.
The following origin codes have been defined:
- DZ. This is the designer
- LS. This represents Linq to sql
- EF. This represents Entity Framework
- NH. This represents NHibernate
- LP. This represents LLBLGen Pro
The Error & Warnings pane has two warning related buttons. One, which is showing two small warning icons, is used to toggle whether the warnings with the codes as the ones selected are hidden / not hidden. The other button shows a slightly dimmed warning icon, which is a toggle button, and when clicked, it is active, and filters dynamically the list of correctable messages: if a warning has a code which is set to be ignored, it's filtered out. If this button is inactive, all warnings are shown, regardless of whether the warnings have codes which are marked to be ignored.
Warnings are hidden / shown using the button to show / hide ignored warnings at the left of the Errors & Warnings pane. Selecting one or more warnings and clicking the button will toggle the ignore flag for the warning number of the selected warning. This is done at the project level. The codes of ignored warnings are stored in the project file and are applied again after the project has been successfully reloaded.