I get enumerable dynamic objects back from a database class which are declared like
IEnumerable<dynamic> sessions = null
I have an extended method that humanising datetimes, adding the day ordinals etc.
DateTime.Now.HumanisedDate()
This works find but I cant apply the extension method directly on the dynamic object
session.STARTDATE.HumanisedDate()
but GetType() for session.STARTDATE says System.DateTime
If I do this
DateTime whatever = session.STARTDATE;
whatever.HumanisedDate()
All is good. I'd like to understand why session.STARTDATE is reported as being a DateTime type but I cannot apply a DateTime extension to it. Thanks all.