Lpt migration problem

Posts   
 
    
dr.agolo
User
Posts: 3
Joined: 15-Jul-2010
# Posted on: 15-Jul-2010 16:48:38   

Hi,

I am trying to migrate lpt files written for LLBL v.1.0.2005 to new 3.0 Final version. But I am having trouble because I can't find some classes and properties in new LLBL 3.0 version.

This is the part of mentioned lpt file:

foreach (EntityDefinition related in entity.RelatedEntitiesAndRelations.Keys)
    {
        for (int i = 0; i < ((EntityRelationCollection)entity.RelatedEntitiesAndRelations[related]).Count; i++)
        {
            EntityRelation relation = (EntityRelation)((EntityRelationCollection)(entity.RelatedEntitiesAndRelations[related]))[i];
            if (!relation.RelationIsHidden && !relation.IsUsedForHierarchy &&
                (relation.RelationType == EntityRelationType.OneToOne || relation.RelationType == EntityRelationType.ManyToOne))
            {
                text.Append("\t\t/// <summary> Event thrower for the ").Append(related.Name).Append("Changed event, which is thrown when ");
                text.Append(related.Name).Append(" changes value. Databinding related.</summary>\n");
                text.Append("\t\tprotected virtual void On").Append(relation.UtilizingPropertyName).Append("Changed()\n\t\t{\n\t\t\tif (");
                text.Append(relation.UtilizingPropertyName).Append("Changed != null)\n\t\t\t{\n\t\t\t\t").Append(relation.UtilizingPropertyName).Append("Changed(this, new EventArgs());\n\t\t\t}\n\t\t}\n");
            }
        }
    }

Also, can you please tell me where can I find Reference Manual for 3.0 SDK?

Thanks in advance.

MTrinder
User
Posts: 1461
Joined: 08-Oct-2008
# Posted on: 16-Jul-2010 01:11:12   

Which classes and properties in particular are you unable to find ?

The SDK manual is included as part of the SDK download.

Matt

dr.agolo
User
Posts: 3
Joined: 15-Jul-2010
# Posted on: 16-Jul-2010 09:34:39   

Hi,

in particular I can't find following properties and classes: - Property _RelatedEntitiesAndRelations _ in **EntityDefinition ** class, - **EntityRelationCollection ** class - **EntityRelation ** class

All of these classes I use in lpt file (LLBL v.1.0) when I want to iterate through collection of entity relations.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39767
Joined: 17-Aug-2003
# Posted on: 16-Jul-2010 10:19:00   

V3 uses a different object model. Please check the LLBLGen Pro v3.0 Designer Core Assemblies reference manual and 'LLBLGen Pro v3.0 SDK documentation'. (both in chm format).

Also, please check the linq to sql and nhibernate templates which are in .lpt format and which will give a good insight in how to obtain information you'd like to retrieve.

There's also a helper class, GeneratorUtils, which will provide information about relationships for example so you can use that in .lpt templates so it's easier to consume the object model.

Frans Bouma | Lead developer LLBLGen Pro
dr.agolo
User
Posts: 3
Joined: 15-Jul-2010
# Posted on: 16-Jul-2010 12:29:39   

Thanks for fast reply. I will try to figure out solution by looking .lpt files for NHibernate and Linq to SQL like you said so.

I would really appreciate if you could tell me is there any alternative for token <[If Not EntityFieldOverrides]> that was present in TDL for LLBL 1.0, but it seems that now in new version is not. I have looked templates for LLBL Gen framework and didn't find any similar token.

Thanks in advance.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39767
Joined: 17-Aug-2003
# Posted on: 16-Jul-2010 17:03:40   

dr.agolo wrote:

Thanks for fast reply. I will try to figure out solution by looking .lpt files for NHibernate and Linq to SQL like you said so.

I would really appreciate if you could tell me is there any alternative for token <[If Not EntityFieldOverrides]> that was present in TDL for LLBL 1.0, but it seems that now in new version is not. I have looked templates for LLBL Gen framework and didn't find any similar token.

Thanks in advance.

That token has been removed, as in v3 no field overrides another field anymore. In earlier versions PK fields could override a supertype's pk field, but in v3 a subtype always inherits the PK of its supertype, so you can forget about that TDL statement. See the v3.0 SDK docs for all the tdl statements available in v3.

Frans Bouma | Lead developer LLBLGen Pro