Use of parameters for LINQ to SharePoint

Source: Internet
Author: User

ManyArticle

Http://bbs.winos.cn/thread-91036-1-1.html

I will not discuss it here

This article describes how to use parameters to generate referenced files by using LINQ.

The parameter is used when the spmetal tool under C:/program files/common files/Microsoft shared/Web Server Extensions/14/bin is used to generate a list object file.

For example

Spmetal/Web: http: // localhost/parameters: parameters. xml/language: CSHARP/code: entities. CS

The XML file that references parameter is mainly because we can configure the list that I want to read in this file, if no parameter is added, all lists and content types on the website are read.

The format of the parameter. xml file is as follows:

<? XML version = "1.0" encoding = "UTF-8"?> <Br/> <web class = "entities" accessmodifier = "public" <br/> xmlns = "http://schemas.microsoft.com/SharePoint/2009/spmetal"> <br/> <list name = "linqtosharepoint" member =" linqtosharepoint "> <br/> <contenttype name =" item "class =" linqtosharepoint "> <br/> <column name =" title "member =" title "/> <br /> <excludeothercolumns/> <br/> </contenttype> <br/> </List> <br/> <excludeotherlists/> <br/> </Web> <br />

The class in the Web node is the class file name generated by spmetal.

The list node reads the list.

The content type of the contenttype node that reads the list. Specifically, name indicates the content type.

Column is the name of the read field.

After these parameters are set, you can run the spmetal command.

The generated entities. CS file only contains the list you need.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.