Can't get entityAdapter.template to generate my interface as part of the class implementation

Posts   
 
    
webbsk
User
Posts: 17
Joined: 24-Sep-2009
# Posted on: 11-Jan-2011 00:59:25   

Hi,

I am trying to use the entityAdapter.template to modify my entities so that it looks like they implement interfaces that I generate.

For example, on this following line of code:


public <[If UsePartialClasses]>partial <[EndIf]>class <[CurrentEntityName]>Entity : <[ If IsSubType ]><[ SuperTypeName ]>Entity<[ Else ]>CommonEntityBase<[ EndIf ]>, ISerializable<[Foreach AdditionalInterfaces]>, <[CurrentAdditionalInterface]><[NextForeach]><[ UserCodeRegion "AdditionalInterfaces" ]>

I have tried to add

, I<[CurrentEntityName]>

to the end of it like this:

public <[If UsePartialClasses]>partial <[EndIf]>class <[CurrentEntityName]>Entity : <[ If IsSubType ]><[ SuperTypeName ]>Entity<[ Else ]>CommonEntityBase<[ EndIf ]>, ISerializable<[Foreach AdditionalInterfaces]>, <[CurrentAdditionalInterface]><[NextForeach]><[ UserCodeRegion "AdditionalInterfaces" ]>, I<[CurrentEntityName]>

What I want is the say for example the Entity is named Orders, it will looks like the following:

public partial class OrdersEntity : CommonEntityBase, ISerializable, IOrdersEntity

However, nothing is generated at all.

I have modified the file successfully before. In a related matter, I was able to add the interfaces' namespace to the beginning of the entity's class file by adding:

using <[RootNamespace]>.EntityContracts;

to the top of the file.

However, in this case this insertion method has not worked. Can anyone see what I have done wrong here?

Thanks, Sam.

Attachments
Filename File size Added on Approval
entityAdapter.template 10,831 11-Jan-2011 01:01.30 Approved
daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 11-Jan-2011 08:34:01   
public <[If UsePartialClasses]>partial <[EndIf]>class <[CurrentEntityName]>Entity : <[ If IsSubType ]><[ SuperTypeName ]>Entity<[ Else ]>CommonEntityBase<[ EndIf ]>, ISerializable<[Foreach AdditionalInterfaces]>, <[CurrentAdditionalInterface]><[NextForeach]><[ UserCodeRegion "AdditionalInterfaces" ]>, I<[CurrentEntityName]>

You are placing your tag inside the <[ UserCodeRegion "AdditionalInterfaces" ]> tag, so it's invalid. Place it before that tag:

public <[If UsePartialClasses]>partial <[EndIf]>class <[CurrentEntityName]>Entity : <[ If IsSubType ]><[ SuperTypeName ]>Entity<[ Else ]>CommonEntityBase<[ EndIf ]>, ISerializable<[Foreach AdditionalInterfaces]>, <[CurrentAdditionalInterface]><[NextForeach]>, I<[CurrentEntityName]><[ UserCodeRegion "AdditionalInterfaces" ]>
David Elizondo | LLBLGen Support Team
webbsk
User
Posts: 17
Joined: 24-Sep-2009
# Posted on: 11-Jan-2011 15:27:19   

Thanks, David! That worked like a charm! simple_smile