Hello all,
I have a scenario that I need to override a method which is used inside a Transaction Scope in the loop. Assume the method I am going to override is
public virtual GLTran TheMethod(Batch batch)
{
//Do stuff
return tran;
}
The way the method is called is
public virtual void TheReleaseDoc(JournalEntry je)
{
// Some loops and stuff here
foreach (Something)
{
// Do more stuff
GLTran tran = TheMethod(je.BatchModule.Current);
je.GLTranModuleBatNbr.Insert(tran);
}
// More loops and stuff here
}
I know I can initiate a new graph instance or use EntityHelper and then from the created graph instance access the viewes or methods BUT what I need is to access the same instance of the graph “je” from “TheMethod” to insert a copy of the “je.BatchModule.Current” and “je.GLTranModuleBatNbr.Insert(tran)” from inside “TheMethod”.
Is it possible to access a data record current instance of Cache and Graph? If yes, how can I do that?