This is a migrated thread and some comments may be shown as answers.

HighLow Keygen

1 Answer 65 Views
Data Access Free Edition
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Adrian
Top achievements
Rank 2
Adrian asked on 06 Sep 2012, 03:22 PM
I have a problem with orm generator:
When execut the code ddlScript is null and not contain ddl scrip for create Voa_Keygen Table
I wand to use this cod for generate invoice number in a concurency mode not for primary key.
Who has experience with this ?
ModelContext dbContext = new ModelContext();
dbContext.Metadata.UniqueIdGenerator.CreateTable = true;
dbContext.Metadata.UniqueIdGenerator.TableName = "Sample";
ISchemaHandler schemaHandler = dbContext.GetSchemaHandler();
string ddlScript = schemaHandler.CreateUpdateDDLScript(null);


I use Openaccess 2012.2.816.1

1 Answer, 1 is accepted

Sort by
0
Jan Blessenohl
Telerik team
answered on 07 Sep 2012, 08:40 AM
Hello Adrian,
The context.Metadata is just a copy of the real metadata that is passed to the context in the constructor. Your changes are not taken in account. Can you change the original metadata by overriding the

protected virtual void OnDatabaseOpen(BackendConfiguration backendConfiguration, MetadataContainer metadataContainer)

Method in you context? If your context is generated, just add a partial class with the same name and override OnDatabaseOpen and put your code there.

metadataContainer.UniqueIdGenerator.CreateTable = true;
metadataContainer.UniqueIdGenerator.TableName = "Sample";

Kind regards,
Jan Blessenohl
the Telerik team
Follow @OpenAccessORM Twitter channel to be the first one to get the latest updates on new releases, tips and tricks and sneak peeks at our product labs!
Tags
Data Access Free Edition
Asked by
Adrian
Top achievements
Rank 2
Answers by
Jan Blessenohl
Telerik team
Share this question
or