This question is locked. New answers and comments are not allowed.
Hi,
I want to know how to translate the following linq code to telerik openaccess code with scope:
LINQ TO SQL
| using (ModelDataContext db = new ModelDataContext()) |
| { |
| db.Transaction = db.Connection.BeginTransaction(); |
| Invoice inv = new Invoice() |
| { |
| TotalAmount = 1000 |
| Type = "A" |
| }; |
| db.Invoices.InsertOnSubmit(inv); |
| db.SubmitChanges(); |
| InvoiceDetail det = new InvoiceDetail() |
| { |
| IdInvoice = inv.Id, |
| Product = "Product A", |
| Quantity = 1 |
| Price = 1000 |
| }; |
| db.InvoiceDetails.InsertOnSubmit(det); |
| db.SubmitChanges(); |
| db.Transaction.Commit(); |
| } |
OpenAccess
| using(IObjectScope scope = ObjectsLibrary.GetNewObjectScope()) |
| { |
| ?????? |
| } |
Thannks.