Page 1 of 1
Generic Schema
Posted: Wed 27 Nov 2013 13:34
by Ekki
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
Re: Generic Schema
Posted: Thu 28 Nov 2013 11:48
by MariiaI
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.
Re: Generic Schema
Posted: Thu 28 Nov 2013 13:11
by Ekki
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
Re: Generic Schema
Posted: Fri 29 Nov 2013 12:11
by MariiaI
There's still an attribute [DatabaseAttribute(Name = "ig")] in the generated code
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.
Please refer to
http://www.devart.com/linqconnect/docs/ ... Kinds.html and in the Entity Developer documentation: ORM Support-> LinqConnect-> Concepts-> Model Generation Templates.