Benutzer:MovGP0/SharePoint/LINQ
Zur Navigation springen
Zur Suche springen
MovGP0 | Über mich | Hilfen | Artikel | Weblinks | Literatur | Zitate | Notizen | Programmierung | MSCert | Physik |
LINQ to SharePoint[Bearbeiten | Quelltext bearbeiten]Exportieren von Listen und Inhaltstypen[Bearbeiten | Quelltext bearbeiten]
Create Classes using SPMetal[1][Bearbeiten | Quelltext bearbeiten]
cd "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\BIN\"
SPMetal /web:"http://sharepoint/site/" /code:"SiteModel.cs" /language:"csharp" /namespace:"Company.Product" /user:"DOMAIN/USER" /password:"..." /serialization:"unidirectional"
SPMetal /web:"http://sharepoint/site" /code:OutPutFileName.cs /language:csharp /parameters:SPMetal.xml
<?xml version="1.0" encoding="utf-8"?>
<Web AccessModifier="Internal" xmlns="http://schemas.microsoft.com/SharePoint/2009/spmetal">
<List Name="ListName">
<ContentType Name="ContentTypeName" Class="GeneratedClassName" />
</List>
<ExcludeOtherLists></ExcludeOtherLists>
</Web>
Example: Get Published Documents[Bearbeiten | Quelltext bearbeiten]var uri = new Uri("http://spd-01:8080/personal/dijo/_api/");
var client = new DataContext(uri.ToString());
var documents = client.GetList<Documents>("Dokumente"); // class Documents is automatically generated
var publishedDocuments = documents
.Where(d => d.PublicationLevel == SPFileLevel.Published)
.ToList();
Quellen[Bearbeiten | Quelltext bearbeiten]
Internetquellen[Bearbeiten | Quelltext bearbeiten]
|