Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7868083
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T00:53:26+00:00 2026-06-03T00:53:26+00:00

I am working on a solution that extracts all the class associations between each

  • 0

I am working on a solution that extracts all the class associations between each other. If we click a class in the object browser we can see the option Find All References. I want something similar that finds the associations a class has to other classes. How can we find them using Reflection?

I am interested in Extracting

  1. Composition Relationship:
  2. Aggregation Relationship
  3. Association Relationship
  4. Inheritance
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T00:53:28+00:00Added an answer on June 3, 2026 at 12:53 am

    You can use Reflection in order to list all properties, fields and methods (and more) of a class. You would have to inspect these and determine their types and parameter lists. Probably it would be a good idea to discard types from the System namespace.

    Type t = typeof(MyClass);
    
    // Determine from which type a class inherits
    Type baseType = t.BaseType;
    
    // Determine which interfaces a class implements
    Type[] interfaces = t.GetInterfaces();
    
    // Get fields, properties and methods
    const BindingFlags bindingFlags =
        BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic;
    FieldInfo[] fields = t.GetFields(bindingFlags);
    PropertyInfo[] properties = t.GetProperties(bindingFlags);
    MethodInfo[] methods = t.GetMethods(bindingFlags);
    
    foreach (var method in methods) {
        // Get method parameters
        ParameterInfo[] parameters = method.GetParameters();
    }
    

    Intellisense will tell you (almost) all the secrets of FieldInfo, PropertyInfo, MethodInfo and ParameterInfo. You might also consider examining the generic parameters of the class, events and more.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working with a solution that contains an ASP.NET website and class library
I want a solution for tag:hover that is not working on ie6. My guess
I'm working on an e-commerce solution for one of my clients that will not
I'm working on a project for a firm that has their main solution in
I am working on a solution that implements adding text to textboxes but I
I have the first large solution that I am working on using MVC3. I
I have a working solution that reports progress & text to a progress bar
Has anyone else had this issue and found a working solution? I've enabled the
Im searching for the best practice (or any working solution) for the following scenario:
Good day. Has somebody working solution for deleting asset in nested form in Carrierwave?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.