I am trying to use reflection to create object array of the type created from reflection like the folowing:
Client[] newArray = new Client[] {client1, client2};
I need to somehow get the Client object type to create the object so it can be passed through.
Any help would be greatly appreciated.
Cheers,
Rob
object clientObject = testAssembly.CreateInstance(".Testing_Automation.Client");
Type client = testAssembly.GetType(".Testing_Automation.Client");
// Create Client Object Array
Passing to:
public Appointment(IEnumerable<Client> client, string time)
You should use
Array.CreateInstancemethod:To get an
IEnumerable<Client>from the array, you could use(IEnumerable<Client>)arrif you know theClienttype at compile time. If you don’t, which is likely, you should post more info about the possibilites of that method call.