HighLow Keygen

2 posts, 0 answers
  1. Adrian
    Adrian  avatar
    15 posts
    Member since:
    Dec 2010

    Posted 06 Sep 2012 Link to this post

    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
  2. Jan Blessenohl
    Admin
    Jan Blessenohl avatar
    707 posts

    Posted 07 Sep 2012 Link to this post

    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!
  3. DevCraft banner
Back to Top