Hi!
I am currently working by Adapter scenario (using LLBLGen Pro version 1.0.2004.Final released on Septermber, 24th) on a project that has tables as following:
LeasingAgreement:
LeasingAgreementId (PK),
...
AgreementObjectType
AgreementObjectTypeId (PK),
...
AgreementObjectTypeAttribute
AgreementObjectTypeAttributeId (PK),
AgreementObjectTypeId (FK to AgreementObjectType table),
...
AgreementObject:
AgreementObjectId (PK),
AgreementObjectTypeId (FK to AgreementObjectType table),
...
AgreementObjectAttributeValue:
AgreementObjectAttributeValueId (PK)
AgreementObjectId (FK to AgreementObject table),
AgreementObjectTypeAttributeId (FK to AgreementObjectTypeAttribute table),
AgreementObjectAttributeValue (varchar),
...
LeasingAgreementObject:
LeasingAgreementObjectId (PK),
LeasingAgreementId (FK to LeasingAgreement table),
AgreementObjectId (FK to AgreementObject table)
This sets LeasingAgreement:AgreementObject as m:n.
In my code I am creating LeasingAgreement object with subordinate objects in following code:
LeasingAgreementEntity agreement = new LeasingAgreementEntity();
...
AgreementObjectEntity object1 = new AgreementObjectEntity();
object1.AgreementObjectTypeId = 1;
AgreementObjectAttributeValueEntity value1 = new AgreementObjectAttributeValueEntity();
value1.AgreementObjectTypeAttributeId = 1;
value1.AgreementObjectTypeAttributeValue = "value1";
AgreementObjectAttributeValueEntity value2 = new AgreementObjectAttributeValueEntity();
value2.AgreementObjectTypeAttributeId = 2;
value2.AgreementObjectTypeAttributeValue = "value2";
agreement.AgreementObject.IsReadOnly = false; // if I don't do this I get InvalidOperationException.
object1.AgreementObjectAttributeValue.Add(value1);
object1.AgreementObjectAttributeValue.Add(value2);
agreement.AgreementObject.Add(object1);
new DataAccessAdapter().SaveEntity(agreement, true, null, true);
After save, only LeasingAgreement table has inserted data and none of the others. Where is the problem? I know there were some hotfixes (I haven't installed) after the release I am using, but I am not sure that any is fixing this type of problem. I also know that were discussions on similar subject, but I still don't know how to solve this problem. I haven't hidden any of relations, so I could save entity like this, right?
Please help! It's very urgent.
Thanks.