AnantLabs / codesmith

Automatically exported from code.google.com/p/codesmith
1 stars 0 forks source link

Primary Keys in the dbml are not in sync with actual table structure. #499

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a table without a primary key.
2. Run Plinqo for the first time to create necessary files.
3. Go into Enterprise Manager, change an existing field to be a primary key.
4. Call Generate Outputs inside Visual studio.
5. Review the dbml. It will not show that the field is now a primary key.
6. The same happens if you remove the primary key flag within Enterprise 
Manager. The dbml does not stay in sync.

What is the expected output? What do you see instead?

When changing a field to be a primary key, or not be a primary key, the dbml 
should be updated accordingly and stay in sync with the database table.

What version of the product are you using?

Whatever version is released as of 10/15/2010. Also using VS 2010 and Sql 
Server 2008 R2.

Please provide any additional information below.

It should also be noted that the Entity code generated by Plinqo creates a 
method GetByKey() when a table has a primary key, or GetTableId() when there is 
no primary key. These methods get changed when the table changes and they match 
what is in Enterprise Manager. However, since the dbml doesn't get changed, the 
Entity methods are also out of sync with the dbml. Thus, Plinqo acts 
inconsistently across different parts of the code base.

Original issue reported on code.google.com by brian...@gmail.com on 15 Sep 2010 at 9:25

GoogleCodeExporter commented 9 years ago
This issue was updated by revision r1948.

- make IsPrimaryKey update

Original comment by paul.wel...@gmail.com on 17 Sep 2010 at 3:36

GoogleCodeExporter commented 9 years ago

Original comment by paul.wel...@gmail.com on 17 Sep 2010 at 3:37