How can i call a method from a static class passing a type of dynamic in generic. Here is my static class:
public static class Log<T>
{
private readonly static ILog Logger = LogManager.GetLogger(typeof(T));
public static void LogInfo(string message)
{
Logger.Info(message);
}
}
I want to call LogInfo like this:
Log<myObject.GetType()>.LogInfo("Some String");
My question is about how to pass a type of myObject in Generic, because the type of this object is dynamic.
ILogand a class namedLogthat doesn't implementILog. I'd advise against that.