Q:

convert class string to class

I have the code below in my ASP.NET app, I would like to convert converterName variable to
Class and pass it to FillRequest<T> method.
Is it possible? 
var converterName = HttpContext.Current.Items["ConverterName"] as string;
FillRequest<Web2ImageEntity>(Request.Params);

Alternatively I could do
    var converterName = HttpContext.Current.Items["ConverterName"] as string;

if (converterName == "Web2ImageEntity")
    FillRequest<Web2ImageEntity>(Request.Params);

but I have about 20 entity classes and I would like to find a way to write code as short as possible.

A:

That would not be possible as the generic type needs to be specified at the compile time.
What you can do is change the FillRequest method to be something like below and then use reflection to do the desired task
FillRequest(string[] params,Type converter)
{
  //Create object from converter type and call the req method
}

Or make the FillRequest take a Interface 
FillRequest(string[] params, IConverter c)
{
 //call c methods to convert
}

Calling this would be something like:
   var type = Type.GetType(converterName);
   FillRequest(Request.Params,(IConverter)Activator.CreateInstance(type));

