How I can do something like this? I have found How do I use reflection to call a generic method? but not sure that this is my case.
public class XmlSerializer
{
public string Serialize<T>(T obj) where T : class
{
return string.Empty;
}
}
class Program
{
static void Main(string[] args)
{
MakeRequst<string>("value");
}
public static void MakeRequst<T>(T myObject)
{
var XmlSerializer = new XmlSerializer();
XmlSerializer.Serialize<T>(myObject);
}
}