I have the following code in a method of a class:
XmlSerializer serializer = new XmlSerializer(typeof(FooClass));
How do I pass into the constructor or a parameter of the class - the foo class?
I think it has something to do with reflection as you can't pass as a parameter just a class name - so the following code makes some sort of sense (thanks to Aidan) -
XmlSerializer serializer = new XmlSerializer(Type.GetType("namespace.FooClass"));