 <p>You have to use Reflection, please look at</p> <p><a href="http://stackoverflow.com/questions/737151/how-to-get-the-list-of-properties-of-a-class">How to get the list of properties of a class?</a></p> <p>I added a new double? property at your class.</p> <pre><code> class Class1 { public int Age { get; set; } public string Family { get; set; } public string Name { get; set; } public double? d { get; set; } } [Test] public void MyTest() { Class1 c = new Class1() { Age = 12, Family = "JR", Name = "MAX" }; foreach (var prop in c.GetType().GetProperties().Where(x =&gt; x.PropertyType == typeof(double?))) { Console.WriteLine("{0}={1}", prop.Name, prop.GetValue(c)); prop.SetValue(c, (double?)null); // set null as you wanted } } </code></pre>