Generally to resolve a type name you would need to provide more information than just the class name. So I guess the answer is "not exactly".
The method for mapping a string to a type is Type.GetType
, which is documented here: https://learn.microsoft.com/en-us/dotnet/api/system.type.gettype?view=netframework-4.7.2
As you can see, in a vacuum we can't say that "Helper"
or "IHelper"
would be sufficient. You probably could get by with a namespace-qualified class name. (The reason why Helper
works in the "hard-coded" syntax, of course, is that the compiler can take advantage of using
statements in deciding what Helper
should mean. That option doesn't work when GetType
is trying to understand a string at runtime.)
If you can provide a custom resolver, maybe you can make it work exactly as you describe.