Migration to LLBLGen 3. GetFieldByName method.

Posts   
 
    
miloszes
User
Posts: 222
Joined: 03-Apr-2007
# Posted on: 05-Jun-2010 12:39:12   

Hi,

In my project I'am using a GetFieldByName method to check whether a field value has changed and trigger some data in OnBeforeEntitySave method. After a 3.0 migration a compiler says that mentioned method doesn't exists. How can I check whether a specified entity's field has changed in OnBeforeEntitySave method (LLBLGen 3).

Kind Regards, MiloszeS

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39903
Joined: 17-Aug-2003
# Posted on: 05-Jun-2010 21:51:00   

selfservicing I presume? the method was in entitybase? Or did you mean the Onbeforeentitysave in adapter?

Frans Bouma | Lead developer LLBLGen Pro
miloszes
User
Posts: 222
Joined: 03-Apr-2007
# Posted on: 06-Jun-2010 12:17:59   

Otis wrote:

selfservicing I presume? the method was in entitybase? Or did you mean the Onbeforeentitysave in adapter?

Sorry I wasn't precise. I'am using an adapter template.

The mentioned method overrides a method from the EntityBase2 class.

protected override void OnBeforeEntitySave()

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 07-Jun-2010 05:21:48   

OnBeforeEntitySave is still on EntityBase2. You should be able to override it. Are you sure you generated code for Adapter template?

David Elizondo | LLBLGen Support Team
miloszes
User
Posts: 222
Joined: 03-Apr-2007
# Posted on: 07-Jun-2010 10:23:51   

daelmo wrote:

OnBeforeEntitySave is still on EntityBase2. You should be able to override it. Are you sure you generated code for Adapter template?

Yes, I'm overriding the "OnBeforeEntitySave" method. The problem is that I've used (2.6) a method GetFieldByName to determine whether an entity field has changed or not. In 3.0 I cannot find a mentioned method. Can you tell me how can I figure out whether a specified field value has changed or not in LLBLGen 3 ?

Best Regards, MiloszeS

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 07-Jun-2010 14:17:05   

Instead please use use:

this.Fields[fieldName];