I am developing a class TypeTranslatorthat has a method Type TranslateType(Type type). This method gets the type of interface, and if there is a class of the name of the interface without a leading I, it creates it, otherwise an exception is thrown.
Here is some code to clear what was written earlier:
class Program
{
interface IAnimal { }
class Animal : IAnimal { }
void Function()
{
TypeTranslator typeTranslator = new TypeTranslator();
Assert(typeTranslator.TranslateType(typeof(IAnimal) == typeof(Animal)));
}
}
code>Is it possible to get what I want?
Thanks for the help!
source
share