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 7574773
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T16:31:04+00:00 2026-05-30T16:31:04+00:00

Given: System.Type instance. The aim is to get the newly-introduced methods (i don’t know

  • 0

Given: System.Type instance.

The aim is to get the newly-introduced methods (i don’t know the right word) in the type, which are
– not inherited
– not overridden

I want to use .NET Reflection and I tried the Type.GetMethods() method. But, it returned even inherited and overridden ones.

I thought of filtering after getting all the methods. And I looked at the properties/methods exposed by MethodInfo class. I could not figure how to get what I wanted.

For instance: I have a class,
class A { void Foo() { } }

When I invoke typeof(A).GetMethods() , I get Foo along with the methods in System.Object: Equals, ToString, GetType and GetHashCode. I want to filter it down to only Foo.

Does anyone know how to do this?

Thanks.

  • 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-05-30T16:31:05+00:00Added an answer on May 30, 2026 at 4:31 pm

    GetMethods has an overload that lets you specify BindingFlags. E.g. so if you need to get all declared, public, instance methods you need to pass the corresponding flags.

    var declaredPublicInstanceMethods = 
        typeof(A).GetMethods(BindingFlags.DeclaredOnly | BindingFlags.Public | BindingFlags.Instance);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given that I don't know at deployment time what kinds of system my code
I've got a System.Generic.Collections.List(Of MyCustomClass) type object. Given integer varaibles pagesize and pagenumber, how
Given two shorts ( System.Int16 ) short left = short.MaxValue; short right = 1;
Given an instance of System.Reflection.Assembly .
Given this MSDN article, we learn that the Common Type System in .Net has
I have a LINQ to SQL query which produces an object of type {System.Data.Linq.DataQuery}.
In a given trading system, the input prices are of type double . The
I have an instance of System.Type that represents an interface, and I want to
Given below are two methods which create a delegate to set a field in
I need to know if a Type implements an interface. Dim asmRule As System.Reflection.Assembly

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.