I am using a LINQ to SharePoint query to return items from a SharePoint list.
var myOpenTasksQuery = from myTasks in tasks
where myTasks.TaskStatus != TaskStatus.Completed
select myTasks
However, the list I am requesting is an OOTB Tasks list; there are several fields with several choices (Status, Priority) that translate into enumerations. In my query results, the status of the task item is returned as "_2Normal", and not as "(2) Normal" as I expected. I see in the proxy file generated by SPMetal.exe that there is a ChoiceAttribute list to list the status of the task, which contains the required value:
public enum Priority : int {
None = 0,
Invalid = 1,
[Microsoft.SharePoint.Linq.ChoiceAttribute(Value="(1) High")]
_1High = 2,
[Microsoft.SharePoint.Linq.ChoiceAttribute(Value="(2) Normal")]
_2Normal = 4,
[Microsoft.SharePoint.Linq.ChoiceAttribute(Value="(3) Low")]
_3Low = 8,
}
How can I modify the query above to return the correct value?
Thanks, MagicAndi.