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 querying, an OOTB Tasks list, there are a number of multi-choice fields (Status, Priority), which are translated into enumerations. In my query results, a task item status is returned as "_2Normal", and not as "(2) Normal" as I would expect. I see in the proxy file generated by SPMetal.exe that there is a ChoiceAttribute for the task status enumeration which contains the value I require:
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.