Where you have the type as a variable you don't really have a good candidate for generic methods, especially as your method returns nothing.
You would be better off with:
public void Duplicate(Type entityType) { ... }
Then your code becomes:
Type myType = anObject.GetType();
myObject.Duplicate(myType);
You can use Jon Skeet's (correct) answer to call your method by reflection, but I can't see what you gain by this method being generic.
The purpose of generics is to preserve the type - so that you don't have to box/unbox value types and so on.
However your duplicate method has no return (it's a void
) and no input parameters. Essentially the only input is the type-parameter. This means that somewhere inside your generic method you're probably doing something like:
public void Duplicate()
{
...
Type inputType = typeof(EntityType);
...
}
In that case you're not gaining anything by EntityType
being a generic type-parameter rather than a regular input parameter, and you're adding the need for awkward and slow reflection when you don't know the input at compile time.