No, you can't define parameters for a base class.
But what you can do is to add a conditional binding for string insted.
Bind<string>().ToConstant(MyConnectionString).When ...
Here you have some options:
1.
When(request =>
typeof(BaseClass).IsAssignableTo(request.Target.ReflectedType))
2. Create a ConectionStringAttribute and use
WhenTargetHas<ConectionStringAttribute>()
public ClassA([ConectionStringAttribute]string connectionString) :
base(connectionString)
3. Use the convention the all connection strings parameters have
the same name
WhenTargetNamed<"connectionString">()
And create the following extension method
public static IBindingInNamedWithOrOnSyntax<T>
WhenTargetNamed<T>(this IBindingWhenSyntax<T> syntax,
string name)
{
return syntax.When(
request =>
request.Target != null &&
request.Target.Name.ToUpper(CultureInfo.InvariantCulture) ==
name.ToUpper(CultureInfo.InvariantCulture));