Hi,
my use case requires full parameterization of database name and schema name. While the database name is already parametric, I face the issue that the schema name is part of the table annotations in the generated context files:
[Table(Name = @"""<SCHEMA>"".""<TABLE>""")]
What is the correct way to solve this (really hope there's a way…)?
Thx ia,
Ekki
Generic Schema
Re: Generic Schema
Please do the following:
- clear the "Preserve schema name in storage" check box in the Model Settings (double-click on the diagram);
- re-create your model in order to changes become effective for all Entity classes ( select "Regenerate Storage and Mapping" from the diagram shortcut menu or use the "Update Model from Database" wizard with the selected "Recreate Model" option);
- save the changes to re-generate the code.
After this you should get the following:
Please tell us if this helps.
- clear the "Preserve schema name in storage" check box in the Model Settings (double-click on the diagram);
- re-create your model in order to changes become effective for all Entity classes ( select "Regenerate Storage and Mapping" from the diagram shortcut menu or use the "Update Model from Database" wizard with the selected "Recreate Model" option);
- save the changes to re-generate the code.
After this you should get the following:
Code: Select all
[Table(Name = @"""Table""")]
Re: Generic Schema
just works!
There's still an attribute [DatabaseAttribute(Name = "ig")] in the generated code but this is obviously ignored as I can set the database when creating the Context.
You guys rock!
Ekki
There's still an attribute [DatabaseAttribute(Name = "ig")] in the generated code but this is obviously ignored as I can set the database when creating the Context.
You guys rock!
Ekki
Re: Generic Schema
If you don't want to use attribute mapping, you can also use file mapping with LinqConnect template (set Mapping Mode to File in the Model settings) or use the POCO Entity and Fluent Mapping templates.There's still an attribute [DatabaseAttribute(Name = "ig")] in the generated code
Please refer to http://www.devart.com/linqconnect/docs/ ... Kinds.html and in the Entity Developer documentation: ORM Support-> LinqConnect-> Concepts-> Model Generation Templates.