I'm trying to use Linq2SharePoint to get a count if items in a document library using the following code:
var context = new MyDataContext(webUrl);
var count = (from item in context.MyDocumentLibrary.ScopeToFolder("/", true).OfType<NewBusinessApplication>()
where item.NewBusinessStatus = "Validation"
This should return a count of all NewBusinessApplication documents in all folders with the NewBusinessStatus of Validation.
If a run this on a document library with a mixture of document types it behaves as expected. However, if a workflow has run on one of the NewBusinessApplication documents I get and InvalidCastException.
It appears from the stack trace that the error is when it's mapping the SPListItem to the concrete type generated by SPMetal but I can't find the specific column that's causing the issue.
Any suggestions or known issues I should look o
View Complete Post