User Code Region in a field setter

Posts   
 
    
CowHills
User
Posts: 47
Joined: 14-Mar-2007
# Posted on: 25-Aug-2011 09:14:47   

I'm trying the modify the adapter template and I'm not able to add a user code region in a field property setter.

I've added the following lines:

<[ UserCodeRegion "<[EntityFieldName]>" ]> // __LLBLGENPRO_USER_CODE_REGION_START <[EntityFieldName]> // __LLBLGENPRO_USER_CODE_REGION_END <[ EndUserCodeRegion ]>

This results in the following generated code: public virtual System.String Id { get { object valueToReturn = base.GetCurrentFieldValue((int)RepairFieldIndex.Id); if(valueToReturn == null) { valueToReturn = TypeDefaultValue.GetDefaultValue(typeof(System.String)); } return (System.String)valueToReturn; } set { UserCodeRegion"Id" ]> // __LLBLGENPRO_USER_CODE_REGION_START Id // __LLBLGENPRO_USER_CODE_REGION_END

    SetNewFieldValue((int)RepairFieldIndex.Id, value); 
}

}

Off course this isn't working sunglasses . Is there a way to modify the template in such a way that I can add a User Code Region in a field setter (or Getter).

Cheers, Andre

Walaa avatar
Walaa
Support Team
Posts: 14986
Joined: 21-Aug-2005
# Posted on: 25-Aug-2011 10:47:09   

Please try without the quotes:

<[ UserCodeRegion <[EntityFieldName]> ]>
// __LLBLGENPRO_USER_CODE_REGION_START <[EntityFieldName]>
// __LLBLGENPRO_USER_CODE_REGION_END
<[ EndUserCodeRegion ]>
CowHills
User
Posts: 47
Joined: 14-Mar-2007
# Posted on: 25-Aug-2011 11:17:56   

Thank you for the suggesting but I've already tried that.

It results in the following code:

UserCodeRegionPKey ]> // __LLBLGENPRO_USER_CODE_REGION_START PKey // __LLBLGENPRO_USER_CODE_REGION_END

By the way....we're still using 2.0 flushed

Walaa avatar
Walaa
Support Team
Posts: 14986
Joined: 21-Aug-2005
# Posted on: 25-Aug-2011 11:54:38   

The following is what teh SDk Docs suggests:

<[UserCodeRegion EntityFieldName "($VALUE)"]>
     // __LLBLGENPRO_USER_CODE_REGION_START <[ UserCodeRegionName ]>
     // __LLBLGENPRO_USER_CODE_REGION_END
<[EndUserCodeRegion]>

Use it as it is.

CowHills
User
Posts: 47
Joined: 14-Mar-2007
# Posted on: 25-Aug-2011 12:12:49   

Walaa wrote:

The following is what teh SDk Docs suggests:

<[UserCodeRegion EntityFieldName "($VALUE)"]>
     // __LLBLGENPRO_USER_CODE_REGION_START <[ UserCodeRegionName ]>
     // __LLBLGENPRO_USER_CODE_REGION_END
<[EndUserCodeRegion]>

Use it as it is.

Nice....very nice smile

I've been looking for the SDK document but I can't find on the website. Could you help me out. Thank you very much for your support.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 25-Aug-2011 19:38:59   

[quotenick="CowHills"]

Walaa wrote:

I've been looking for the SDK document but I can't find on the website. Could you help me out.

David Elizondo | LLBLGen Support Team