title: In a Generic Provider how to find and edit properties of T? (C#)
body: <p>So, I'm making a generic provider for my repositories implementation which will be used by my BaseController (ASP.NET MVC 2) for low-level objects. These objects have common operations, such as Activate/Deactivate/Delete/Edit, so I'll always be working with the same property on each. The problem is, since I don't know what T is, I obviously don't have access to its properties.</p>
  
  <p>So, my question is, can someone show me how to get the properties I need out of the objects. I've seen some people talking about Reflection, others Expression Trees, neither of which I know how to use.</p>
  
  <p>I do have a generic repository which I believe uses Expression Trees (copied it from some website), but again, I don't know what I'm doing with it... If it helps, here's what I've got so far:</p>
  
  <pre><code>public class Provider&lt;T&gt; where T : class {
      private readonly Repository&lt;T&gt; Repository = null;
  
      public Provider(
          Repository&lt;T&gt; Repository) {
          this.Repository = Repository;
      }
  
      public void Activate(
          int Id) {
          T Entity = this.Repository.Select(Id);
  
          // Need to get the property here, change it and move on...
  
          this.Repository.Submit();
      }
  }
  </code></pre>
  
  <p>I'd appreciate any help on this.</p>