title: C# : LINQ query to list all empty properties of a class
body: <p>I have a class like this : </p>
  
  <pre><code>public class Test
  {
      public string STR1{ get; set; }
      public INT INT1{ get; set; }
      public DOUBLE DBL1{ get; set; }
      public DATETIME DT1{ get; set; }
  }
  </code></pre>
  
  <p>Normally, before saving the object, i will have to check all the properties inside this Class, and return a warning message if there is any empty/null property. There is easy way to do this by simply check each property like this : </p>
  
  <pre><code>if (string.IsNullOrEmpty(t.STR1))
      return "STR1 is empty"
  if (t.INT1 == 0)
      return "INT1 = 0";
  if (t.DBL1 == 0)
      return "DBL1 = 0";
  if (t.DT1 == DateTime.MinValue)
      return "DT1 is empty"
  </code></pre>
  
  <p>But what if my class has more properties, actually it contains about 42 properties now, and still growing up. So i was thinking for a "cleaner" way to perform this check, and i found this topic which is quiet similar to my issue : <a href="https://stackoverflow.com/questions/6916155/reflection-check-for-null-or-empty-for-each-property-field-in-a-class">Reflection (?) - Check for null or empty for each property/field in a class?</a></p>
  
  <p>But this solution does not meet my need as i have to list the values that = null/empty string/0/DateTime.MinValue </p>
  
  <p>Believe me, i wanted to post my "tried code" but i can't figure out a sensible LINQ query for this task (i'm a novice in C#) </p>
  
  <p>Any help is greatly appreciated !</p>