You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. The application connects to a Microsoft SQL Server 2008 database. You create classes by using LINQ to SQL based on the records shown in the exhibit. (Click the Exhibit button.) You need to create a LINQ query to retrieve a list of objects that contains the OrderID and CustomerID properties. You need to retrieve the total price amount of each Order record. What are two possible ways to achieve this goal? (Each correct answer presents a complete solution. Choose two.)
A.
From details In dataContext.Order_Details _ Group details By details.OrderID Into g _ Join order In dataContext.Orders On g.Key = order.OrderID _ Select New With { _ .OrderID = order.OrderID, _ .CustomerID = order.CustomerID, _ .TotalAmount = g.Sum(Function(od) od.UnitPrice * od.Quantity) _ }
B.
dataContext.Order_Details.GroupJoin(dataContext.Orders, Function(d) d.OrderID, Function(o) o.OrderID, Function(dts, ord) New With { _ .OrderID = dts.OrderID, _ .CustomerID = dts.Order.CustomerID, _ .TotalAmount = dts.UnitPrice * dts.Quantity _ })
C.
From order In dataContext.Orders _ Group order By order.OrderID Into g _ Join details In dataContext.Order_Details On g.Key = details.OrderID _ Select New With { _ .OrderID = details.OrderID, _ .CustomerID = details.Order.CustomerID, _ .TotalAmount = details.UnitPrice
* details.Quantity _ }
D.
dataContext.Orders.GroupJoin(dataContext.Order_Details, Function(o) o.OrderID, Function(d) d.OrderID, Function(ord, dts) New With { _ .OrderID = ord.OrderID, _ .CustomerID = ord.CustomerID, _ .TotalAmount = dts.Sum(Function(od) od.UnitPrice * od.Quantity) _ })