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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:37:20+00:00 2026-05-23T01:37:20+00:00

I have the following interface: public interface Iface { void Sample1(); void Sample1(bool value);

  • 0

I have the following interface:

   public interface Iface
   {
      void Sample1();
      void Sample1(bool value);
   }

And the implementation is shown below. Note: It is requried that Sample1’s implementation be explicit (due to generic constraints voodoo)

   public class myCLass : Iface
   {
      void Iface.Sample1()
      {
         this.Sample1(true);
      }
      void Iface.Sample1(bool value)
      {
      }
   }

Trying to call the overload, however, results in this error:

Error 5 ‘myCLass’ does not contain a definition for ‘Sample1’ and no extension method ‘Sample1’ accepting a first argument of type ‘myCLass’ could be found (are you missing a using directive or an assembly reference?) Q:\common\VisualStudio\Charting\Drilldowns.cs 18 15 Charting

Bottom line: I think I’m unsure of the syntax I should be using to call the ‘other’ overload in the same interface.

  • 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-23T01:37:21+00:00Added an answer on May 23, 2026 at 1:37 am

    Since you’re implementing the interface explicitly, you need to cast yourself to the interface:

    ((IDrilldown)this).Sample1(true);
    

    Or, if you don’t like the in-line cast:

    IDrilldown idd = (IDrilldown)this;
    idd.Sample1(true);
    

    If you did a normal, implicit implementation, you’d be able to call the method directly. Explicit interface implementations are only usable on a variable specifically defined as that interface.

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

Sidebar

Related Questions

I have the following class structure that I need to unit test: public interface
If I have the following Interface structure; public interface IPaymentTypeBase { void PayNow(); double
I have the following code: public interface IDrilldown { void AddCriteria<T>(T Criterion); } public
I have the following class & interface defined: public interface A { } public
I have the following code: public interface IService { } public class MyService :
I have the following two classes and I am starting to see a pattern
I'm interested to know if there is an interface that I can use to
I have a bunch of repository classes which I want to unit-test using Visual
I am developing an piece of software where I have a few entities such
I'm doing some R&D work, and as such am exploring design patterns. I have

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.