No MARS issues come in if your code has nested calls opening DB objects like:
foreach(var ttOrderDtl_Iterator in ds.OrderDtl.Where(x=> x.Company == Session.CompanyID && (x.RowMod == "A" || x.RowMod == "U")))
{
var Part_Row = Db.Part.With(LockHint.NoLock).Where(x=> x.Company == Session.CompanyID && x.PartNum == ttOrderDtl_Iterator.PartNum && x.CheckBox03).FirstOrDefault();
...
}
That is an open query in the foreach AND the Parts call. So the Parts call can be changed to:
var Part_Row = Db.Part.With(LockHint.NoLock).Where(x=> x.Company == Session.CompanyID && x.PartNum == ttOrderDtl_Iterator.PartNum && x.CheckBox03).ToList();
.ToList() materializes list for use in EFCore Contains()
As I mentioned Claude helped me uplift the BPMs I needed to modify. If you ask it to comment the lines modified it’ll do so and explain the changes. It also cleaned up some un-needed Foreach loops and such as most of our C# BPMs weren’t written by me.
Test the BPMs after uplifting either manually or with AI help of course. Sometimes the AI didn’t quite fix it correctly.