How to make an if statement to show xml attribute based on current time
问题 I have a XML like this: <PrayerTime Day ="1" Month="5" Fajr="07:00" Sunrise="09:00" Zuhr="14:00" /> A class like this: public class PrayerTime { public string Fajr { get; set; } public string Sunrise { get; set; } public string Zuhr { get; set; } } And something to get the value like this: XDocument loadedCustomData = XDocument.Load("WimPrayerTime.xml"); var filteredData = from c in loadedCustomData.Descendants("PrayerTime") where c.Attribute("Day").Value == myDay.Day.ToString() && c