vendredi 23 juillet 2021

Create

I'm new in the Reflection field, and I really need some guidance, need to convert a small block of code to be valid for runtime.

This part is done currently manual:

Telegram ReqInstance = new Telegram();
Telegram ResInstance = await comm.SendMethodAsync<Telegram>(ReqInstance)

But I need to do this at runtime, The first part I've managed to do it (creating the instance) but I don't know how to call the await part

Type type = typeof(Telegram);
Assembly assembly = Assembly.GetAssembly(type);
Object instance = Activator.CreateInstance(assembly.FullName, "Telegram").Unwrap();




Aucun commentaire:

Enregistrer un commentaire