User Profile

Collapse

Profile Sidebar

Collapse
Skychan
Skychan
Last Activity: Feb 19 '08, 04:33 PM
Joined: Feb 19 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Skychan
    replied to Inner type of a Nullable type (C#)
    in .NET
    Here is the solution:

    determine if the Type is a nullable type and if it is then call Nullable's static method GetUnderlyingTy pe()

    http://msdn2.microsoft.com/en-us/lib...lyingtype.aspx

    That was unbelievably hard to find out and it makes no sense that to find out what the inner type is, a static method has to analyze the nullable type. It would make more sense for a nullable type...
    See more | Go to post

    Leave a comment:


  • Skychan
    replied to Inner type of a Nullable type (C#)
    in .NET
    typeof(int?).Ba seType returns:
    {Name = "ValueType" FullName = "System.ValueTy pe"} System.Type {System.Runtime Type}

    typeof(int?).Ba seType.BaseType returns:
    {Name = "Object" FullName = "System.Object" } System.Type {System.Runtime Type}

    I have looked through all the methods and properties of the BaseType but I can't find any information about int32....
    See more | Go to post

    Leave a comment:


  • Skychan
    started a topic Inner type of a Nullable type (C#)
    in .NET

    Inner type of a Nullable type (C#)

    I need to get the Inner Type of a Nullable Type (not an instance of given Nullable Type).

    For example, if I have:
    Type myType = typeof(int?);

    How can I determine that myType has an Inner Type of System.int32?

    Thanks
    See more | Go to post
No activity results to display
Show More
Working...