Hi,
I'm not sure if i should keep asking questions about a beta product, because most of my questions probably will explain themselves in the final release.
Nevertheless:
In the futue, will we be able to change the model in the schema modeller, and generate the datacontext afterwards ?
For example, i want certain primary keys (GUID) to auto-generate themselves on insert, but i don't know how to set that option.
I've tried to set isdbgenerated = false, hoping a key would be generated. but eventually that is no option because that modification would be gone when i regenerate the datacontext from reverse engineering.
somehow related topic about auto-increment: http://devart.com/forums/viewtopic.php?t=12769
Would it be an idea to start a seperate forum for LINQ 2 SQL ?
Regards,
Yuri.
LINQ2SQL beta: modify scheme in modeller, and autogen PK's
-
- Posts: 27
- Joined: Mon 08 Sep 2008 16:37
Please give us an example to clarify the question. Now you can edit the model in Schema Modeler (to add new classes and new properties to them, to edit the existing entries).In the futue, will we be able to change the model in the schema modeller, and generate the datacontext afterwards ?
Now you can set the "Auto Generated Value" and "Auto-Sync" properties in Schema Modeler. They allow you to organize the work with autoincrement columns in database. Do you want to generate GUIDs at the client side and transfer them to database afterwards?For example, i want certain primary keys (GUID) to auto-generate themselves on insert, but i don't know how to set that option.
This is a good idea. We are considering the possibility of adding new branches at our forum.Would it be an idea to start a seperate forum for LINQ 2 SQL ?
-
- Posts: 27
- Joined: Mon 08 Sep 2008 16:37
-
- Posts: 27
- Joined: Mon 08 Sep 2008 16:37
Let me rephrase that:
Since mysql does not have a guid datatype, i think that when there is a varchar(36) primary key, where the "auto generated value" is set to true, the class should generate a GUID in the constructor to insert in the database.
Ofcourse this can be done manually with every new insert using guid.newguid().
Since mysql does not have a guid datatype, i think that when there is a varchar(36) primary key, where the "auto generated value" is set to true, the class should generate a GUID in the constructor to insert in the database.
Ofcourse this can be done manually with every new insert using guid.newguid().
The "auto generated value" property in Schema Modeler is used for autoincrement columns and for columns whose value is generated in the "instead of insert" trigger. After the insert operation there will be refresh of the field - the obtained database value will be transferred to the program. If a new value is generated in a constructor, meaning of the "auto generated value" property will not correspond to its name.