scaffolded from DB2 and use the same entities in the project. For all select and get Linq queries, the framework is adding the schema name. But it is adding the logged in userid as the schema to while inserting (adding) a new entity to the table.
If we assign the Identity column value to the entity, the framework adds the schema name to the table when context.savechanges called.
But we dont want to assign the identity column value to the entity as it should be generated by the database. In this case, the framework is adding the userid as schema to the table.
------------------------------
Kishan Devunoori
------------------------------
Original Message:
Sent: Thu August 03, 2023 08:53 PM
From: Youssef Sbai Idrissi
Subject: EntityFrameworkCore 7 - context.saveChanges - userid instead of schema is getting added to insert record to DB2 table
This is likely a configuration or mapping issue.
------------------------------
Youssef Sbai Idrissi
Software Engineer
Original Message:
Sent: Thu August 03, 2023 11:45 AM
From: Kishan Devunoori
Subject: EntityFrameworkCore 7 - context.saveChanges - userid instead of schema is getting added to insert record to DB2 table
I am using IBM.EntityFrameworkCore to communicate with DB2. Facing the an issue while context.saveChanges.
The framework is adding logged in userid as the schema name as the prefix to the table when trying to insert a record into the DB2 table.
Actual Error Message: ERROR [42704] [IBM][DB2] SQL0204N "<userid>.<tablename>" is an undefined name.
This is happening while inserting a record into a table which has an Identity Column.
Any help is appreciated.
Thanks in Advance.
------------------------------
Kishan Devunoori
------------------------------