Quantcast
Channel: Visual C# forum
Viewing all articles
Browse latest Browse all 31927

Why convert to object?

$
0
0

Hello all:

To make a study of Convert.ToDateTime with Just-Decompiler, I see this (for an example ONLY):

 [CLSCompliant(false)]
        public static DateTime ToDateTime(uint value)
        {
            return ((IConvertible)(object)value).ToDateTime(null);
        }

My question is: since "value" is type of uint, and that has implemented the interface of "IConvertible", why don't write:

[CLSCompliant(false)]
        public static DateTime ToDateTime(uint value)
        {
            return ((IConvertible)value).ToDateTime(null);
        }

But cast convert to object?


ASP.NET Questions
Other Discussions
FreeRice Donate
Issues to report


Viewing all articles
Browse latest Browse all 31927

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>