Hidden gem: BuildManager.GetType
I’ve been digging through the ObjectDataSource today and I was trying to figure out how they created the datasource instance from the type name.
Now some clever reader might say “I know, I know, Type.GetType(string)”… But that’s wrong..
Type.GetType(string) requires full type names with assembly name and the whole shebang.
The ObjectDataSource is able to create instances w/o all that information.
So after a while of digging I found a precious gem, hidden in System.Configuration:
“BuildManager.GetType(string)”
Very very nice :-)
I can now inherit ObjectDataSource and fetch the type via buildmanager and then call NAspect to proxy the type and get an AOP enabled datasource.
Thats all for now, just wanted to share this one :-)
Design by
it seems that it is under System.Web.Compilation.
ilanchelian
March 13, 2008 at 10:54 am
Hi, when come LINQ to NPersist be finished? It’s so cool!
Johan
March 16, 2008 at 9:05 pm