title: How do I add a pre-event to a property get acessor?
body: <p><strong>Long Description</strong>: I'm writing a basic search by filter function from an entity, so I can do something like this:</p>
  
  <pre><code>public Entity GetEntityBy(Entity filter)
  { }
  public IList&lt;Entity&gt; GetEntitiesBy(Entity filter)
  { }
  </code></pre>
  
  <p>The problem is with non nullable types (int, float, etc), and I don't want to "force" all properties to be written as nullables. I want to avoid any kinds of rules (such as applying attributes or implementing my own get/set) so I can write the entity just as usual and simply use this filter function.</p>
  
  <p>The code looks like this:</p>
  
  <pre><code>public class Entity
  {
      public int EntityID { get; set; }
      public string Name { get; set; }
      public DateTime RegisterDate { get; set; }
      //Other properties
  }
  
  public IList&lt;Entity&gt; GetEntitiesBy(Entity filter)
  {
      if (filter != null)
      {
          if (filter.EntityID &gt; 0)
          {
              //Add criteria to filter by ID
              //In this case it works because there shouldn't have any IDs with 0
          }
  
          //this won't work because DateTime can't be null
          //I can't check the default value as well because there are some searchs using the default value and I don't want to ignore that
          if (RegisterDate != null) 
          {
          }
      }
  }
  </code></pre>
  
  <p>It's supposed to be a simple equal filter depending on the values found in the <code>filter</code> parameter, but as it is now I don't know when I should ignore the default values or not.
  I already have a SCRUD manager sort of class, so I want to add a function call to the class that it belongs so I can check when a property has been read/written to.</p>
  
  <p><strong>Short Description</strong>: How do I <strong>add</strong> a function call before a property's <code>get</code> or <code>set</code> acessor is called on a dynamic class? Is this even possible?</p>