Hi,
I have an existing database-structure and I need to implement an LLBLGen project on top of it. There is a parent-table and a child-table. Both tables have an Identity-field. But the actual key-fields in the parent-table are different. There is a set of two fields, in the parent-table, which have a unique combination of values, which are determined by the application (not by SQL Server). The child-table has a link to the parent-table. But it does not link to the identity-field of the parent-table. Instead, there are two fields, which refer to the unique fields in the parent-table.
I created an LLBLGen-project, based on these tables. I made the two unique fields in the parent-entity 'part of the primary key' (so these are not the identity-field). Then I created a relation between these entities and I let the two fields in child-entity refer to the primary-key fields of the parent-entity. This works fine.
The problem arises when I try to populate some entities with data, in order to update the information in the database. The information has been kept in memory and is now stored back to an entity, so it has not been fetched in the entity. When I try to populate the entity, the identity-field of the parent-entity is readonly. If I don't set the identity-field, a new record will be created in the database. Instead, I want to update an existing record. I want to avoid reading the entity from the database, because I got everything already in memory.
General info: Using latest version of LLBLGen 1.0.2005.1 designer and runtimes. Adapter-scenario. VS 2005. .NET 2.0.
Is there anyway I achieve this? Please suggest. Thanks!
René