J
Jay Allard
Hello
I'm sure this is already posted somewhere, I'm just not using the
correct search words or something.
Anyway, I want to store a class name in a database:
TestApplication.Validators.MyCustomClass
(MyCustomClass is the class name).
MyCustomClass implements an interface named IValidator. I know that
every class specified in the database will implement that interface.
Knowing that, is it possible to dynamically create the object, or do I
have to use reflection?
I'm looking for something like
IValidator v = something.something("TestApplication.Validators.MyCustomClass");
so I can then use the methods defined in the IValidator interface.
v.SetAProperty("whatever");
v.Validate();
Is that possible, or do I have to use reflection and InvokeMember for
each method?
Thanks
Jay
I'm sure this is already posted somewhere, I'm just not using the
correct search words or something.
Anyway, I want to store a class name in a database:
TestApplication.Validators.MyCustomClass
(MyCustomClass is the class name).
MyCustomClass implements an interface named IValidator. I know that
every class specified in the database will implement that interface.
Knowing that, is it possible to dynamically create the object, or do I
have to use reflection?
I'm looking for something like
IValidator v = something.something("TestApplication.Validators.MyCustomClass");
so I can then use the methods defined in the IValidator interface.
v.SetAProperty("whatever");
v.Validate();
Is that possible, or do I have to use reflection and InvokeMember for
each method?
Thanks
Jay