Duplicates generated for adapter use (SQL Server)

Posts   
 
    
mario.muja avatar
mario.muja
User
Posts: 37
Joined: 03-May-2005
# Posted on: 23-Nov-2006 12:00:58   

Hi, whenever I generate code for my SQL Server database, the following method is generated twice and I cannot compile the generated code before removing one of the duplicate methods.

Before generating the code, I remove all existing code from previous generations.

How can I fix this behaviour?

Regards, Mario

/// <summary>Returns a new IEntityRelation object, between UserEntity and UserEntity over the 1:1 relation they have, using the relation between the fields: /// User.UserId - User.UserId /// </summary> public virtual IEntityRelation UserEntityUsingUserId { get {

    IEntityRelation relation = new EntityRelation(SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToOne);



    relation.AddEntityFieldPair(EntityFieldFactory.Create(UserFieldIndex.UserId), EntityFieldFactory.Create(UserFieldIndex.UserId));

    relation.StartEntityIsPkSide = false;
    relation.InheritanceInfoPkSideEntity = InheritanceInfoProviderSingleton.GetInstance().GetInheritanceInfo("UserEntity", false);
    relation.InheritanceInfoFkSideEntity = InheritanceInfoProviderSingleton.GetInstance().GetInheritanceInfo("UserEntity", true);
    return relation;
}

}

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39927
Joined: 17-Aug-2003
# Posted on: 23-Nov-2006 12:42:21   

Check if the user table in sqlserver has an FK defined from userid to userid. If so, remove it, then refresh the catalog and regenerate the code.

Frans Bouma | Lead developer LLBLGen Pro