title: Dynamically create object from SQL data
body: <p>I've been thinking about creating objects dynamically using data stored in a database. I've done something similar in the past by serializing all the properties of each object but that was a few years ago and times have changed.</p>
  
  <p>I actually like the method outlined in the answer to the following question:
  <a href="https://stackoverflow.com/questions/483215/how-to-do-dynamic-object-creation-and-method-invocation-in-net-3-5">How to do dynamic object creation and method invocation in .NET 3.5</a></p>
  
  <p>I'm wondering if it's possible to take this one step further and set all the properties of the object using stored data.</p>
  
  <p>Obviously I could set each of the properties individually IE:
  <br><code>
          Person p = new Person();<br>
          p.Name = "Me";<br>
          p.Age = 31;<br>
  </code><br>
  Would it be possible to do something more in-line (sorry don't quite know what this is called) like <code>Person p = new Person() { Name = "Me", Age = 31 };</code> where the <code>Name = "Me", Age = 31</code> properties or string could originate from a database??</p>
  
  <p>Any thoughts?</p>