linq - Using an SPMetal entity class -


i'm executing code below information page via linq. works fine, how convert , using entity class generated spmetal command?

guid siteguid = spcontext.current.site.id; using (spsite site = new spsite(siteguid)) {     using (spweb web = site.openweb())     {         splist lespages = web.lists["pages"];          var resultat = splistitem page                        in lespages.items                        page.contenttype.name.equals("pagenews") && page.moderationinformation.status.equals(spmoderationstatustype.approved)                        select page;          foreach (splistitem r in resultat)         {             contenu += "_moderationstatus: " + r["_moderationstatus"] + "<br>";             contenu += "fileleafref: " + r["fileleafref"] + "<br>";             contenu += "publishingpagecontent: " + r["publishingpagecontent"] + "<br>";             contenu += "contenttype: " + r["contenttype"] + "<br>";             contenu += "categorie: " + r["categorie"] + "<br>";         }         panelresultat.controls.add(new literalcontrol(contenu));     } } 

use following links

1.sp metal code

2. spmetal tutorial


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -