How can I Find out what BCL types a custom type is using its method?
- by dotnetdev
If I have a class, eg T1, and I want to know what classes in the BCL it is using, how could I do this?
I came up with this:
T1.GetType().GetMethods().Where(x => x.DeclaringType.Namespace == "System");
But this will get all methods in my custom type, but I want to look inside each Method, so I was hoping I could do something like:
T1.GetType().GetMethods().BodyTypesUsed; to check if my method uses a type like Streamwriter.
How could I achieve this?