Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > LLBLGen Pro > Generated code> One Entity assignment changes another's Id
 

Pages: 1
Generated code
One Entity assignment changes another's Id
Page:1/1 

  Print all messages in this thread  
Poster Message
Puromtec
User



Location:
MD
Joined on:
22-Jun-2005 16:38:52
Posted:
48 posts
# Posted on: 08-Sep-2011 19:27:13.  
LLBLGen: 1.0.2005.1
.NET: 2.0
Mode: Adapter


I am not sure why metaParameterEntity.MetaParameterTypeId is getting changed when line 3 executes. is occuring.

Code:
                
1                metaParameterEntity = new MetaParametersEntity();            
                
2                metaParameterEntity.MetaParameterTypes = metaParameterTypeEntity;                

                 //then, metaParameterEntity.MetaParameterTypeId == 5..which is good

3             metaParameterEntity.MetaTypes = metaTypeEntity; //(MetaTypeId = 6)            
                
                 //OOPS....metaParameterEntity.MetaParameterTypeId == 6 now!!!!
                 //ALSO...metaParameterEntity.MetaTypeId = 0 (ok?)

4                metaParameterEntity.Name = parameterName;
                
5                da.SaveEntity(metaParameterEntity, true);
                 //Throws a FK database error (correctly).



In a simple example:

A_Entity = new A_Entity()

A_Entity.B_Entity = b_entity;

A_Entity.C_Entity = c_entity;

//PROBLEM NOW: A_Entity.B_Id == c_entity.C_Id
//and
//A_Entity.B_Id != b_entity.B_Id


I have regenerated the db specific and generic dlls and copied them both to the location of application's reference. What could possibly cause this problem?

Thanks for help, in advance.
  Top
Puromtec
User



Location:
MD
Joined on:
22-Jun-2005 16:38:52
Posted:
48 posts
# Posted on: 08-Sep-2011 21:57:33.  
Problem found:

My database table for the main entity had an incorrect foreign key column set. The FK-PK between the three tables were tangled, basically.


  Top
Pages: 1  


Powered by HnD ©2002-2007 Solutions Design
HnD uses LLBLGen Pro

Version: 2.1.12172008 Final.