I'm fooling around trying to learn the ins an outs of LINQ. I want to convert the following query (which is working correctly) from query syntax to method syntax, but I can't seem to get it right. Can anyone show me the correct way to accomplish that?
var logQuery = from entry in xDoc.Descendants("logentry")
where (entry.Element("author").Value.ToLower().Contains(matchText) ||
entry.Element("msg").Value.ToLower().Contains(matchText) ||
entry.Element("paths").Value.ToLower().Contains(matchText) ||
entry.Element("revision").Value.ToLower().Contains(matchText))
select new
{
Revision = entry.Attribute("revision").Value,
Author = entry.Element("author").Value,
CR = LogFormatter.FormatCR(entry.Element("msg").Value),
Date = LogFormatter.FormatDate(entry.Element("date").Value),
Message = LogFormatter.FormatComment(entry.Element("msg").Value),
ET = LogFormatter.FormatET(entry.Element("msg").Value),
MergeFrom = LogFormatter.FormatMergeFrom(entry.Element("msg").Value),
MergeTo = LogFormatter.FormatMergeTo(entry.Element("msg").Value)
};