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)); } }
Comments
Post a Comment