title: C# conditional based on property
body: <p>I have the following classes</p>
  
  <pre><code>class ClassA : SuperClass { }
  class ClassB : SuperClass { }
  class ClassC : SuperClass { }
  class SuperClass
  {
      int Id { get; set; }
      string Property1 { get; set; }
      string Property2 { get; set; }
      List&lt;string&gt; Property3 { get; set; }
  }
  </code></pre>
  
  <p>When a condition is met, I have to override one, two or all of the properties in any of the classes (A, B, C) and I have to know that the properties were overridden and which ones where. 
  So I created this interface that should be implemented by SuperClass.</p>
  
  <pre><code>public interface IOverride
  {
      string OverrideProperty1 { get; set; }
      string OverrideProperty2 { get; set; }
      List&lt;string&gt; OrderedProperty3 { get; set; }
  }
  </code></pre>
  
  <p>How can I know if a property was overridden without having to create a boolean for each property.
  Or should I go for a different approach?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>ClassA, ClassB and ClassC data come from a specific source and for each of the objects I get information from another source. If the new source has values I need to stored them and override the original ones.</p>
  
  <p>Something like</p>
  
  <pre><code>var dataList = GetClassesData() as List&lt;SuperClass&gt;;
  var newData = GetNewData() as object[];
  
  foreach (var data in dataList)
  {
      if (newData.Contains(o =&gt; o.Id == data.Id))
      {
          data.Property1 = newData[Id].Property1;
          data.Property2 = newData[Id].Property2;
          data.Property3 = newData[Id].Property3;
      }
  }
  </code></pre>