Cast inside the method or let the client code cast, which one is better? I have two choices of implementing a method, the first one is a generic type where the client code does not have to cast

    public T GetControl&lt;T&gt;(string controlName) where T : Control
    {
        return (T)ControlManager.GetControl( controlName);
        //I simplify the logic here, in my case this is a bit 
        //complicated than this, but the object we get is of the Type Control  
    }


client code: 

MyControl control = GetControl&lt;MyControl&gt;("foo");


The second choice is the non-generic one. Here the client code will have to cast

    public Control GetControl(string controlName)
    {
        return ControlManager.GetControl(controlName); 
        // I simplify the logic here, in my case this is a bit 
        // complicated than this, but the object we get is of the Type Control  
    }


client code:

    MyControl control = (MyControl)GetControl("foo");


Is one of them better than the other? At first I thought first one is better, because casting (which I think is a bit dirty) is refactored in one method, and don't have to be repeated in all client codes. But since the generic type has to be specified by the client code anyway (generic methods can't infer return type), basically the client code only shift (MyControl) in front to &lt;MyControl&gt; in the generic parameter, so it's probably not better anyway.

What is your opinion?
In my opinion the generic method is better for two reasons. First, it's cleaner, both for the client calling it because they don't have to cast and for the process of casting because it is only done in one place. Secondly, the client that's asking for the control knows the type of the control in this instance so it's very sensible, and good practice, to have the client specify that rather than sending back an object just so the client has to cast it. That's why generics exist. 

However, I recommend in your code in the method you use the as operator rather than a cast because even though the client calling you specified the type, the as operator will simply return null instead of throwing an exception.