开发者

Linq updating two tables I need Autoid value

开发者 https://www.devze.com 2022-12-14 06:29 出处:网络
I am doing some activity that will update two tables. One of the tables have an autoid which I need inserted in the other table. The field that stores the autoid value is used a like a foreign key to

I am doing some activity that will update two tables. One of the tables have an autoid which I need inserted in the other table. The field that stores the autoid value is used a like a foreign key to different tables depending on context.

When updating I face the problem that the autoinc Id开发者_运维百科 does not have a value until its saved.

i have thought of having separate datacontexts for the two tables doing submit on one before the other but the I guess it will be very slow submitting for each row.

What are my options here, I guess I cannot have the foreign key to multiple tables as that would solve the problem ??

Martin

0

精彩评论

暂无评论...
验证码 换一张
取 消