I have to call below method which has 2 parameter
public static byte[] readdata(string classtype, string msg)
{
Encoding encoding = new System.Text.UTF8Encoding();
string header = $"{classtype},{Guid.NewGuid().ToString()}";
byte[] headerBytes = Encoding.UTF8.GetBytes(header);
var test = JsonConvert.DeserializeObject<classtype>(msg);
i want to pass classtype to method DeserializeObject which i will get at runtime.
but parameter is generic i may get ClassA or ClassB or ClassC
so how can i call method and pass generic class name which i'm getting it into string value?
readdata("ClassA" , "testmessage");