News:

SQL Table To C# Entity Model ConverterEntity Model (Class Properties) to SQL Table ConverterIf you encounter any trouble visiting our site, please contact us.

Advertisement

Looking for job. Try JobLoader- First ever job search engine in Bangladesh. All open bd jobs now a single mouse click away.

;
01 using (AdventureWorksEntities context = new AdventureWorksEntities()){
02
03 foreach (SalesOrderHeader order in customer.SalesOrderHeader){
04Console.WriteLine(String.Format("Order: {0} ", order.SalesOrderNumber));
05 foreach (SalesOrderDetail item in order.SalesOrderDetail){
06Console.WriteLine(String.Format("Quantity: {0} ", item.Quantity));
07Console.WriteLine(String.Format("Product: {0} ", item.Product.Name));
08}
09}
10}

You want to list all the orders for a specified customer. You need to ensure that the list contains the following fields: "Order number "Quantity of products "Product name Which code segment should you insert at line 02?

  1. Contact customer = context.Contact.Where("it.ContactID = @customerId", new ObjectParameter ("@customerId", customerId)).First();
  2. Contact customer = context.Contact.Where("it.ContactID = @customerId", new ObjectParameter ("customerId", customerId)).First();
  3. context.ContextOptions.LazyLoadingEnabled = true; Contact customer = (From contact in context.Contact include("SalesOrderHeader.SalesOrderDetail") select conatct). FirstOrDefault();
  4. Contact customer = (From contact in context.Contact include("SalesOrderHeader") select conatct). FirstOrDefault();
Answer: Answer is b
comments powered by Disqus
Advertisement

BCS Preparation now even more easy. ReadBD is the place where you can find all kind of resources to be successful in BCS,Bank,Islami Bank exam and interview.

Looking for job. Try JobLoader- First ever job search engine in Bangladesh. All open bd jobs now a single mouse click away.

;