How to write this query using LINQ?
Options
Here is a query I am working with in SQLServer 2008.
How can I write this in LinqPad?
Thanks,
Abhijit
SELECT ProcessXML.value(N'(/InstantQuoteModel/ContactEmail)[1]','NVARCHAR(100)'), XmlLogId, UserId FROM XmlLogTable WHERE ProcessXML.value(N'(/InstantQuoteModel/ContactEmail)[1]','NVARCHAR(100)') ='myemailaddress@email.com' order by 1 desc go
How can I write this in LinqPad?
Thanks,
Abhijit
Comments
-
I have solved this by parsing the XML to a string.
Here is myelegantsolution.var ci = from xml in XmlLog where xml.ProcessXml.ToString().Contains("<InstantQuoteModel>") && xml.ProcessXml.ToString().Contains("myemailaddress@email.com") && xml.XmlLogId > 1133006 select xml; ci.Take(100).Dump();