make original value public

Posts   
 
    
mdissel
User
Posts: 92
Joined: 16-Sep-2003
# Posted on: 08-Jul-2004 14:04:56   

Hello

I'm adding logging functionality to the generated code (using selfservicing), but i can't get a the EnitityField.OriginalValue because it's declared as internal. Why is this property internal?

i know it doesn't reflect the database value (the value can change when you use databinding), but i don't use databinding.

Thanks

Marco

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 08-Jul-2004 14:45:41   

mdissel wrote:

I'm adding logging functionality to the generated code (using selfservicing), but i can't get a the EnitityField.OriginalValue because it's declared as internal. Why is this property internal?

OriginalValue is used to store the value when an edit cycle starts in a databinding scenario. This means that when you press ESC after you've edited a grid cell, you'll get the original value back.

i know it doesn't reflect the database value (the value can change when you use databinding), but i don't use databinding.

In the upcoming runtime library revision, I've added DbValue to the fields, which will contain the value read from the database (and CurrentValue will contain this value initially as well of course), except for when it is null, then the default value is set, so it contains the initial value set to CurrentValue after a fetch.

This allows you to add optimistic concurrency based on original field values and also better logging.

Frans Bouma | Lead developer LLBLGen Pro
mdissel
User
Posts: 92
Joined: 16-Sep-2003
# Posted on: 08-Jul-2004 14:50:18   

Thanks.. Even better!! can't wait for the release date wink

mdissel
User
Posts: 92
Joined: 16-Sep-2003
# Posted on: 09-Jul-2004 15:43:07   

Otis wrote:

This allows you to add optimistic concurrency based on original field values and also better logging.

Wil this also mean that you're only going to mark the fields as changed if they're really changed, (different value then in database). Currently EntityField.IsChanged is returning true when you assign a value a the field, even if it's the same value.

Thanks

Marco

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 09-Jul-2004 15:48:12   

mdissel wrote:

Otis wrote:

This allows you to add optimistic concurrency based on original field values and also better logging.

Wil this also mean that you're only going to mark the fields as changed if they're really changed, (different value then in database). Currently EntityField.IsChanged is returning true when you assign a value a the field, even if it's the same value.

That is also fixed: if you set a field to the same value it is no longer marked as 'changed'. optimistic concurrency schemes allow you to produce a COncurrencyPredicateFactory which produces filters which filter for the original db value for a field, if that one has changed, the update shouldn't proceed.

Frans Bouma | Lead developer LLBLGen Pro