Code: Select all
List orderLineIds = new List { 1441932, 1441933, 1441934, 1441935 };
using (TgwWcsDataContext dataContext = DataContextFactory.GetDataContext(this, true)) {
using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required,
new TransactionOptions() { IsolationLevel = System.Transactions.IsolationLevel.RepeatableRead}))
{
IQueryable existingOrderLines = from ol in dataContext.Orderlines
where orderLineIds.Contains(ol.OrderlineId)
select ol;
foreach (Orderline existingOrderLine in existingOrderLines.ToList())
{
existingOrderLine.ChangedOn = DateTime.Now;
dataContext.SubmitChanges();
}
ts.Complete();
}
}
I am using Devart.Data.Oracle,Version=5.70.170.0.