title: Generic Method to fill properties?How do you do it in .net 2.0?
body: <p>I have 2 classes Customer and Person(share exactly the same properties and these properties should be filled in by a request</p>
  
  <p>I would like to write a generic method like</p>
  
  <pre><code>    //Usage Customer myCustomer =CreateCustomerOrPerson&lt;Customer&gt;(myRequest)
      //Usage Person myPerson =CreateCustomerOrPerson&lt;Person&gt;(myRequest)
      public static T FillPropertiesOfCustomerOrPerson&lt;T&gt;(Request request)
      {
         //not sure how I would I do it to fill the properties.
        // T a = default(T);
  
        //a.Name=request.Name;
        //a.Surname=request.Surname;
  
        // if (a is Customer)
         //{
            //?
        /// }
         return (T)a;
      } 
  
      How would you write this generic method to avoid having 2 methods (one for customer and one for person)?
  </code></pre>
  
  <p>Edit</p>
  
  <p>I have no control over these classes. I just need to fill the properties and I was wondering if I could write a generic method rather than 2 specific ones.</p>