title: How to make all model properites nullable in asp net core api
body: <p>I have a scenario i have a ASP Net Core API project which is used across the globe but i have to make all (INT,Long, Double, Decimal) datatypes to nullable. but why? these datatypes has already 0 value by default right? but the issue came recently that some third party call our api by passing null value to int data variable so our api crashed because it was not nullable. Hope you understand the logic why we need to do that.</p>
  <blockquote>
  <p>So how i will be able to do this work? in my opinion, i have two
  options.</p>
  <ol>
  <li>make nullable data types and change all referenced code which is extremely headache.(is it a good approach to change code in all files?)</li>
  <li>use some generic attributes or custom data validation to check the value before being assigned to the parameter value. (But i don't know how to
  achieve this)</li>
  </ol>
  </blockquote>
  <p>Expert, Please advise Can I do something like this?</p>
  <pre><code>&gt; [CheckIIntllegaType]
  &gt; public int testId { get; set; }
  </code></pre>
  <p><strong>Second Issue</strong></p>
  <p>I have models Parent so there are many nested child models so if child model is null so api is also crashing because <code>parent.child.property</code> is causing error as child is null. so is there any way that I can handle this as  generic rather then editing all reference?</p>