Page 1 of 1

Property name overwritten on update from database

Posted: Thu 01 Dec 2011 13:22
by picrap
Hi,

I have a very annoying problem: when a column changes in the DB schema (for example its description), the associated property name is overwritten by its default value.

For example, I have a DB column named "PERC" which means "PersonalCode".
At first generation, I renamed my column from "Perc" (default value) to "PersonalCode" (which is much more convenient, I hope you'll agree :)).
But when the column was updated (even with a very small change such as description update), the property name is set back to "Perc" (right, the default value).

Am I missing something somewhere? Is this a bug?

Thanks for help.
Pascal.

Posted: Mon 05 Dec 2011 13:59
by Shalex
This is a designed behaviour.
Assuming that you are generating Entity Framewok models, Update Model From Database regenerates the corresponding properties in SSDL and CSDL if there are any differences between these properties in SSDL and their columns in database. As a workaround, clear selection of these tables in the update wizard.

Posted: Tue 06 Dec 2011 08:12
by picrap
Why don't you add an option to let the user chose if he wants to update the column name?

Actually, this is very annoying for me, because of two problems:
- comments are not kept when changed, so a comment always marks the column as changed
- a changed column has its name updated

So basically, as you suggest, I find myself analyzing hundreds of columns at each update, while only a few changed are actually significant.

This is a big loss of productivity yet, this is why I'm asking for such a feature.

Posted: Thu 08 Dec 2011 15:00
by Shalex
Update Model From Database Wizard checks for a strict correspondence between database and the SSDL part of your model. This is correct behaviour and it should be applied to comments and column names as well.

If you change the name of your property in CSDL, it will not be detected by Update Model From Database Wizard. But if there are any discrepancies between SSDL and database for the particular column, the update wizard will regenerate this column's CSDL property as well - we will correct this behaviour in the next versions of Entity Developer. We will post here when it is implemented.

Re: Property name overwritten on update from database

Posted: Mon 21 May 2012 10:18
by Shalex
The behaviour will be changed starting from the next build of Entity Developer: the CSDL property will be left unchanged when the corresponding SSDL property is regenerated. We will post here when the corresponding build is available for download.

Re: Property name overwritten on update from database

Posted: Wed 23 May 2012 16:03
by Shalex
New version of Entity Developer 4.4 is released!
It can be downloaded from http://www.devart.com/entitydeveloper/download.html (trial version) or from Registered Users' Area (for users with active subscription only).
For more information, please refer to http://forums.devart.com/viewtopic.php?f=32&t=24187 .