I'm trying to generate classes using SPMetal to make use of SPLINQ. Generating the code is no problem, except the properties are not typed properly.
This is fraction of the code:
[Microsoft.SharePoint.Linq.ListAttribute(Name="Actual Purchase Orders")]
public Microsoft.SharePoint.Linq.EntityList<Item> ActualPurchaseOrders {
get {
return this.GetList<Item>("Actual Purchase Orders");
}
}
As you can see the return type is defined as Microsoft.SharePoint.Linq.EntityList<Item>
. While I'd like it to be Microsoft.SharePoint.Linq.EntityList<ActualPurchaseOrder>
. This is the same case for all lists and all properties for all list. The only properly typed properties are the sharepoint internal ones like Link, Document, HelpFilesDocument, etc.
I checked all list settings, like content types etc. No luck.
Is it just a bug in my 14.0.4763.1000 version?
Any help appreciated. Cheers.
If ActualPurchaseOrder is not a custom contenttype which you have defined, than you will have to override the spmetal tool with a parameters xml file. (http://msdn.microsoft.com/en-us/library/ee535056.aspx)
I think this blogpost will give you some good steps in the right direction: http://socialsp.com/2009/12/11/having-fun-with-the-new-linq-to-sharepoint-on-sharepoint-2010-sp2010/
public Microsoft.SharePoint.Linq.EntityList<*> ActualPurchaseOrders {
*
- >应该是目标列表的内容类型,而不是Item
是默认的内容类型。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.