What are two possible ways to achieve this goal? (Each correct answer presents a complete solution. Choose two.)
A. from details in dataContext.Order_Detailgroup details by details.OrderID into gjoin order in dataContext.Orders on g.Key equals order.OrderID select new {OrderID = order.OrderID, CustomerID = order.CustomerID,TotalAmount = g.Sum(od => od.UnitPrice * od.Quantity)}
B. dataContext.Order_Detail.GroupJoin(dataContext.Orders,d => d.OrderID,o => o.OrderID,(dts, ord) => new {OrderID = dts.OrderID,CustomerID = dts.Order.CustomerID,TotalAmount = dts.UnitPrice * dts.Quantity})
C. from order in dataContext.Orders group order by order.OrderID into gjoin details in dataContext.Order_Detail on g.Key equals details.OrderID select new {OrderID = details.OrderID,CustomerID = details.Order.CustomerID,TotalAmount = details.UnitPrice * details.Quantity}
D. dataContext.Orders.GroupJoin(dataContext.Order_Detail,o => o.OrderID,d => d.OrderID.(ord, dts) => new {OrderID = ord.OrderID,CustomerID = ord.CustomerID,TotalAmount = dts.Sum(od => od.UnitPrice * od.Quantity)})
Answer:A
What are two possible ways to achieve this goal? (Each correct answer presents a complete solution. Choose two.)
A. from details in dataContext.Order_Detailgroup details by details.OrderID into gjoin order in dataContext.Orders on g.Key equals order.OrderID select new {OrderID = order.OrderID, CustomerID = order.CustomerID,TotalAmount = g.Sum(od => od.UnitPrice * od.Quantity)} B. dataContext.Order_Detail.GroupJoin(dataContext.Orders,d => d.OrderID,o => o.OrderID,(dts, ord) => new {OrderID = dts.OrderID,CustomerID = dts.Order.CustomerID,TotalAmount = dts.UnitPrice * dts.Quantity}) C. from order in dataContext.Orders group order by order.OrderID into gjoin details in dataContext.Order_Detail on g.Key equals details.OrderID select new {OrderID = details.OrderID,CustomerID = details.Order.CustomerID,TotalAmount = details.UnitPrice * details.Quantity} D. dataContext.Orders.GroupJoin(dataContext.Order_Detail,o => o.OrderID,d => d.OrderID.(ord, dts) => new {OrderID = ord.OrderID,CustomerID = ord.CustomerID,TotalAmount = dts.Sum(od => od.UnitPrice * od.Quantity)})