You either need to apply the constraint to the interface method as well or remove it from the implementation.
You are changing the interface contract by changing the constraint on the implementation - this isn't allowed.
public interface IMyClass
{
int GetCount(string filter) where T : class;
}