title: how to update all the fields with specific value in a list of object
body: <p>I have a list of an object, I want to update all the fields that are "null" to string.empty. </p>
  
  <p>here is the code:</p>
  
  <pre><code>public class Class1
  {
      public string P1 { get; set; }
      public string P2 { get; set; }
      public string P3 { get; set; }
  }
  </code></pre>
  
  <p>I want to have a code which goes and finda all the null values in all the fields and change the value to string.empty</p>
  
  <pre><code>     static void Main(string[] args)
      {
  
          var list= new List&lt;Class1&gt;();
          var class1 = new Class1 {P1 = "P1-1", P2 = "P2-1", P3="null"};
          list.Add(class1);
          var class2 = new Class1 { P1 = "P1-2", P2 = "P2-2", P3 = "null" };
          list.Add(class2);
  
      }
  </code></pre>
  
  <p>so I would need the class1.P3 and class2.P3 to be found and their value to be replaced.</p>
  
  <p>Thanks</p>