I have the following LINQ-to-XML code. I can get this placed into the myAnon variable. What I want to do is get just the date, into an array of dateTime object, I also want to make this datetime object distinct. So just one copy of each individual date, as there can be many with the same data. Using distinct in the below code doesn't work as time interferes, because my startDateTime value includes to complete date time object.
var myAnon= (from e in pData.Descendants("myData")
startDateTime = Convert.ToDateTime(e.Attribute("startDateTime").Value)
}).OrderBy(p => (DateTime)Convert.ToDateTime(p.startDateTime));
Any useful advice would be gratefully appreciated.
Thanks in advance.