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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T02:33:56+00:00 2026-06-10T02:33:56+00:00

Possible Duplicate: How to call base.base.method()? I have some trouble with Inheritance in C#.

  • 0

Possible Duplicate:
How to call base.base.method()?

I have some trouble with Inheritance in C#. I’ve sketched three classes: A, B and C. C inherits from B and B from A. Now the B class calls base.Method1 and works fine but I can’t call A.method1 from the C class. If I call base.Method1 from C obviously that method will be method1 of B. Any advice?

P.S. in A class there are some fields marked private so you can access them only

class A
{    
    private instance;    
    public virtual void Method1 ()
    {       
        instance = this;
        do something;       
    }
}

class B : A
{
    public override void Method1()
    {
        base.Method1();
        do something;       
    }
}

class C : B
{   
    public override void Method1 ()
    {
        //need A Method1 then do something
    }
}
  • 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-10T02:33:57+00:00Added an answer on June 10, 2026 at 2:33 am

    This is a feature of C#. If you wish to expose this method to class C, consider refactoring A like so:

    class A
    {    
      private instance;    
      public virtual void Method1 ()
      {
        AMethod1();       
      }
    
      protected void AMethod1()
      {
        instance = this;
        do something;       
      }
    }
    

    This will enable you to call this method from within C:

    class C : B
    {   
      public override void Method1 ()
      {
        AMethod1();
        // do something;
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Why is the 'this' keyword required to call an extension method from
Possible Duplicate: How to call a JavaScript function from PHP? I have a php
Possible Duplicate: Does std::list::remove method call destructor of each removed element? I have a
Possible Duplicate: Call non-static method from static method c# We can call non-static method
Possible Duplicate: Calling base method using JavaScript prototype I want to inheritance object that
Possible Duplicate: Calling virtual function of derived class from base class constructor? I have
Possible Duplicate: Use reflection to invoke an overridden base method Normally I can call
Possible Duplicate: Is there a way to call an object's base class method that's
Possible Duplicate: CakePHP: Call to a member function find() on a non-object I have
Possible Duplicate: How to call javascript function from c# Is there a way to

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.