So I have a method that Creates a new object like so:
public class Objects<TObject>
{
public NodeReference<TObject> CreateObject<TObject>(TObject objectType)
where TObject: class, new()
{
NodeReference<TObject> nodeReference = 0;
return nodeReference;
}
}
Now I have other object classes that define other object type like, Car.
public class Car
{
public int NumberOfDoors {get; set;}
public int NumberOfWheels {get; set;}
}
Now lets say I get passed a string how would I convert this string into its type at runtime?
var carObjectReference = CreateObject<//string converted to identify object car dynamically>(//new Car { });