One Entity assignment changes another's Id

Posts   
 
    
Puromtec
User
Posts: 76
Joined: 22-Jun-2005
# 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.

                
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.

Puromtec
User
Posts: 76
Joined: 22-Jun-2005
# 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.