Default Mapping Errors

This article is relevant to entity models that utilize the deprecated Visual Studio integration of Telerik Data Access. The current documentation of the Data Access framework is available here.

When you use default mapping, Telerik Data Access takes care of the property to column mapping. Or in other words, when you have a Model First Scenario and you use the default mapping functionality, Telerik Data Access will try to create corresponding table and columns in the relational part of your domain model. Sometimes Telerik Data Access is not able to generate the default tables and column mapping due to invalid definitions in your model.

In the following example, the Person domain class contains a property with an invalid name.

Using the Table Editor

The first way to default map a domain class is to use the Map to Table.... context menu command (right-click the domain class in the Visual Designer and select Map to Table...). If everything is OK with your domain class, Telerik Data Access will open the Table Editor and will automatically create column definitions. However, if there is something wrong with the domain class (e.g. invalid property name) and your entity cannot be automatically mapped, then Telerik Data Access will open again the Table Editor, but an error message will be displayed.

In order to fix the error, you need to close the Table Editor, open the Errors Pane in the Visual Studio environment and double click the error. This will open the Validation Dialog where you can fix the issues. Most of the validation rules have resolution actions - manual or automatic, which can be applied immediately to resolve the inconsistencies in your domain model. For more information, please refer to How to: Validate a Domain Model.

Using the "Use Default Mapping" Option

The second way to default map a domain class is to use the "Use Default Mapping" option in the Mapping Details Editor. Again, if everything is OK with your domain class, Telerik Data Access automatically creates a table in the relational part of the model and maps all properties to columns. However, if there is something wrong with the domain class (e.g. invalid property name), Telerik Data Access will automatically navigate you to Errors Pane in Visual Studio and will select the error. The resolution is the same - double click the error and fix the issue by using the Validation Dialog.