I would like to delete from multiple tables using telerik open access within the one transaction - so if there is a problem with any of the deletions, they all roll back.
This is the code I have come up with after reading documentation, however I suspect that each 'DeleteAll' is running a seperate transaction rather than waiting for the 'SaveChanges()' at the end. Is that true? If so, how else can I accomplish what I am trying to do (i.e. all deletes in the one transaction)?
int deleted = 0;
using (PortalContext dbContext = new PortalContext())
{
var bars = dbContext.GetAll<xxx>().Where(x => x.a == user.a && x.b == b && x.c >= sessionStart);
deleted += bars.DeleteAll();
var badss = dbContext.GetAll<yyy>().Where(x => x.a == user.a && x.b == b && x.c >= sessionStart);
deleted += badss.DeleteAll();
var bads = dbContext.GetAll<zzz>().Where(x => x.a == user.a && x.b == b && x.c >= sessionStart);
deleted += bads.DeleteAll();
var trades = dbContext.GetAll<aaa>().Where(x => x.a == user.a && x.b == b && x.c >= fromTime);
deleted += trades.DeleteAll();
var balances = dbContext.GetAll<bbb>().Where(x => x.a == user.a && x.b == b && x.c >= fromTime);
deleted += balances.DeleteAll();
dbContext.SaveChanges();
}