I am trying to build a Events Calendar, where i am getting the dates/events from an XML file in C#
I am loading my xml document through this:
XDocument myEventsDocument = XDocument.Load(Server.MapPath("Events.xml"));
Then I am storing the events in a variable :
var resultSet = from p in myEventsDocument.Descendants("event")
select new
{
eventName = p.Attribute("title").Value,
eventVenue = p.Attribute("venue").Value,
eventDate = p.Attribute("date").Value,
eventTime = p.Attribute("time").Value,
eventDuration = p.Attribute("LengthOfEventInMts").Value
};
Then I am caching the entire results:
Cache.Insert("eventsCache", resultSet, new CacheDependency(Server.MapPath("Events.xml")));
In the DayRender event of the Calendar class, I am storing the Cached result in a non-generic collection of IEnumeration:
IEnumerable itemCache = (IEnumerable)Cache["eventsCache"];
When i loop through the items in itemCache, I am not seeing the items in intellisense, but when i step-over while debugging, i am seeing the IEnumerable items.
Please help me out where i am going wrong.