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/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With