How would you build up this query with Entity Framework :
SELECT *
FROM TreeNodes
WHERE data.value('(/edumatic/assessmentItem/@type)[1]', 'nvarchar(max)') like 'multiplechoice1'
data column is XML. Apparently this is converted to a string by the Entity Framework...
This is my start but from here I wouldn't know how to add the where...
var query = from e in edumatic3Context.TreeNodes
where e.Data.???????
select e;
foreach (var treeNode in query)
Console.WriteLine("{0} {1} {2} {3}", treeNode.TreeNodeId, treeNode.Name, treeNode.Type, treeNode.DateChanged);
I also tried something like following code but that didn't work either:
var sql = "SELECT VALUE treeNode FROM TreeNodes as treeNode WHERE data.value('(/edumatic/assessmentItem/@type)[1]', 'nvarchar(max)') like 'multiplechoice1'";
var query = edumatic3Context.CreateQuery<TreeNodes>(sql);
foreach(...)