Hi,
I have several tables; some are connected, some are not. During save, when I save a record in table A, it should create a record in table B. Table B has ID field that should be retrieved from table A's ID. However, there's no association between table A & B. I can't add association because ID field in table A is also used by other tables as foreign key.
During Save process, the table A's ID saved in table B are not fixed up, because there's no association.
To solve this issue, I tried to use EntityServerSaveInterceptor to intercept the save process. Here's what I'm trying to do in the interceptor.
using (TransactionScope scope = new TransactionScope(TransactionScopeOption.RequiresNew))
{
TransactionSettings.Default = new TransactionSettings(IsolationLevel.ReadCommitted, TimeSpan.FromSeconds(30), true);
base.ExecuteSave();
//get ID value in table A
//update the ID field in table B
scope.Complete();
return true;
}
However, I get error:
"The transaction specified for TransactionScope has a different IsolationLevel than the value requested for the scope."
I'm not sure whether this is allowed. If not, could anyone suggest a solution ? Thanks a lot !