Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 776669
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T19:29:08+00:00 2026-05-14T19:29:08+00:00

Ok, im still a bit new to using nullable types. I’m writing a reflecting

  • 0

Ok, im still a bit new to using nullable types.

I’m writing a reflecting object walker for a project of mine, im getting to the point where im setting the value of a reflected property with the value i’ve retrieved from a reflected property.

The value i’ve retrieved is still in object form, and it dawned on me, since i want my object walker to return null when it can’t find something, (I thought about throwing an exception, but i want this to soft-fail when something’s wrong).

Anyway, some of the values im setting/getting are decimal bool etc… so it dawned on me that i should just NOT set a non-nullable value, but I realized I straight up don’t know how to tell decimal from decimal?

Is it enough to key on if the Type of the property im setting is inherited from ValueType?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T19:29:08+00:00Added an answer on May 14, 2026 at 7:29 pm

    The following code will tell you whether a type is nullable or not:

    private bool IsNullableType(Type theType)
    {
        return theType.IsGenericType && 
               theType.GetGenericTypeDefinition().Equals(typeof(Nullable<>));
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm still a bit new to git, and I use gitg to visualize trees.
I am still a little bit new to C# and I was wondering how
I'm still relatively new to hadoop, and I've been learning a bit about it
I am still a bit new to Windows programming and sometimes find the documentation
I'm still a bit new on jquery selection syntax (and jquery in general). I'm
I might be approaching this problem completely wrong, but I'm still a bit new
I am still a bit new to dojo, javascript and HTML coding. I inherited
still a bit of a n00b on SharpSVN, I'm looking to get some simple
after reading the cookbook and various Q&A here I am still a bit confused
I still feel a bit unsafe about the topic and hope you folks can

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.