OrderInfo thisOrder = await _context.OrderInfo .Where(o => o.OrderNumber.Equals("ORDER_1") && o.Business.BusinessId.Equals("BUSSINES_X")) .Include(o => o.OrderLines) .ThenInclude(oh => oh.OrderHistory) .Include(o => o.OrderLines) .ThenInclude(oh => oh.OrderLineMap) .ThenInclude(olm => olm.DeviceIndex) .Include(o => o.OrderLines) .ThenInclude(oh => oh.CartonLineMap) .ThenInclude(clm => clm.Carton) .ThenInclude(c => c.Devices) .Include(o => o.OrderProperties) .Include(o => o.OrderLines) .ThenInclude(oh => oh.Product) .ThenInclude(op => op.ProductProperties) .Include(o => o.Customer).SingleOrDefaultAsync();
// Northwnd inherits from System.Data.Linq.DataContext. Northwnd nw = new Northwnd(@"northwnd.mdf"); Customer cust = new Customer(); cust.CompanyName = "SomeCompany"; cust.City = "London"; cust.CustomerID = "98128"; cust.PostalCode = "55555"; cust.Phone = "555-555-5555"; nw.Customers.InsertOnSubmit(cust); // At this point, the new Customer object is added in the object model. // In LINQ to SQL, the change is not sent to the database until // SubmitChanges is called. nw.SubmitChanges();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)