Setting entity framework relevant properties

Posts   
 
    
chrissie
User
Posts: 84
Joined: 05-Oct-2010
# Posted on: 17-Jun-2011 16:21:37   

Hi,

I would like to Know, where I can set entity Framework relevant properties. Actually I have to set the StoreGeneratedPattern but can not find it in the designer. After searching for this in the forum I found, that the StoreGeneratedPattern is set automatically for fields of type TIMESTAMP (which is ROWVERSION). But I need to set the StoreGeneratedPattern for a attribute of typt int.

Thanx in advance, regards

Chris

MS Windows 7 SP 1 Visual Studio 2010 SP 1 .Net Framerwork 4.0 MS SQL Server 2008 R2 MS EF 4.0 LLBLGen Pro 3.1

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 17-Jun-2011 19:11:48   

There is no property on your Propject Properties. This is done autmatically for secuenced fields (so identity fields).

David Elizondo | LLBLGen Support Team
chrissie
User
Posts: 84
Joined: 05-Oct-2010
# Posted on: 20-Jun-2011 09:41:21   

Hallo David,

thank you very much for your answer. This sounds great. But please, tell me, where i can define, that an attribute is an identiy? I did not found it yet.

Thank you very much in advance,

regards

Chris

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 20-Jun-2011 09:51:55   

where i can define, that an attribute is an identiy? I did not found it yet.

Do you mean a field is an identity field?

In the field mapping subTab, you select a value in the Sequence column.

chrissie
User
Posts: 84
Joined: 05-Oct-2010
# Posted on: 20-Jun-2011 09:53:47   

Hi Walaa,

that is the answer i hoped for. thanx and regards,

Chris

chrissie
User
Posts: 84
Joined: 05-Oct-2010
# Posted on: 07-Jul-2011 12:16:21   

Hi,

although I closed this thread, I have to come back here:

After generating I miss the StoreGeneratedPattern = "Computed" is not in place in my *.edmx file. Wht do I have to do to get it generated in my *.edmx file?

Thanx in advance,

regards

Chris

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 07-Jul-2011 14:03:32   

See : http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=19702

Computed is emitted only for fields which are retrieved from the DB as a computed column. Otherwise it's not emitted (as it's not possible to define a column with an expression in the designer).

On what kind of column do you need 'computed' to be emitted?

Frans Bouma | Lead developer LLBLGen Pro
chrissie
User
Posts: 84
Joined: 05-Oct-2010
# Posted on: 07-Jul-2011 18:25:13   

Hi,

I need it for a attribute of type timestamp (which is rowversion). We have revised our model and added an attribute TIMESTAMP to every table, defined a .net type of byte[] and in the table field editor i have choosen timestamp as the DB type. As I read in this forum some time ago, this should lead to an entry StoreGeneratedPattern="Computed" in the StorageModel within the *.edmx file. Actually I do this manually after generating the code. On the other hand, the entry ConcurrencyMode="fixed" IS generated in the CenceptualModel section of the *.edmx file.

regards

Chris

MTrinder
User
Posts: 1461
Joined: 08-Oct-2008
# Posted on: 07-Jul-2011 21:33:10   

On the linked thread http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=19702 there is attached a fixed template which should resolve your issue - have you tried this ?

Matt

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 07-Jul-2011 21:50:48   

that fix has been rolled into the latest build already. But what you should do is refresh the model from the database. (See the other thread why this is needed at this point). Model first timestamp fields are not marked as such in the relational model data (that's only done by drivers when you refresh). So doing a refresh (which shouldn't change anything) will mark the fields as 'timestamp' and should fix the problem.

Frans Bouma | Lead developer LLBLGen Pro
chrissie
User
Posts: 84
Joined: 05-Oct-2010
# Posted on: 08-Jul-2011 10:25:15   

This is right, I just tested it (and published this message in the wrong thread). Thank you very much,

regards

Chris