我需要在 SharePoint 中查询一个列表,将来可能会在其中添加列。例如,目前我有以下列名称,工作,兴趣,地址我希望能够使用浏览器中的参数动态查询此字符串,因此如果将来添加列,我不必更改代码但只是参数。地址可能看起来像这样 www.contoso.com/sites/mypage.aspx?property=Interests 而代码就在这行:
var SiteParameter = Request.QueryString["property"];
var ItemsFromList = from item in ListItems where item[try to put the parameter in here] select item;
我使用 SPmetal 来获取列表详细信息,所以如果我按 item。Visual Studio2010 将返回列表中的列。