For example, say you have
class Item { }
class Book: Item { }
and you have an object declaration such as
Item myBook = new Book();
you could cast it to the subclass with the code
Book myBookCasted = myBook as Book;
What I would like to know is if there is a method, probably with reflection, to cast the instance to the subclass with a string instead of the type name? Something like:
Book myBookCasted = myBook as "Book";
But with the correct syntax of course.
Thanks.