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.
I actually like the method outlined in the answer to the following question: How to do dynamic object creation and method invocation in .NET 3.5
I'm wondering if it's possible to take this one step further and set all the properties of the object using stored data.
Obviously I could set each of the properties individually IE:
Person p = new Person();
p.Name = "Me";
p.Age = 31;
Would it be possible to do something more in-line (sorry don't quite know what this is called) like Person p = new Person() { Name = "Me", Age = 31 };
where the Name = "Me", Age = 31
properties or string could originate from a database??
Any thoughts?