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.

;
01var uri = new Uri(@"http://contoso.com/Northwind.svc/");
02var ctx = new NorthwindEntities(uri);
03var categories = from c in ctx.Categories 04select c;
04foreach (var category in categories) {
05PrintCategory(category);
06
07foreach (var product in category.Products) {
08
09PrintProduct(product);
10}
11}

You need to ensure that the Product data for each Category object is lazy-loaded. What should you do?

  1. Add the following code segment at line 06.

    ctx.LoadProperty(category, "Products");
  2. Add the following code segment at line 08.

    ctx.LoadProperty(product, "*");
  3. Add the following code segment at line 06.

    var strPrdUri = string.Format("Categories({0})?$expand=Products", category.CategoryID);
    var productUri = new Uri(strPrdUri, UriKind.Relative);
    ctx.Execute <Product>(productUri);

     

  4. Add the following code segment at line 08.

    var strprdUri= string.format("Products?$filter=CatgoryID eq {0}", category.CategoryID);
    VarProdcutUri = new Uri(strPrd, UriKind.Relative);
    ctx.Execute <Product>(productUri);
Answer: Answer is a
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.

;