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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T15:18:47+00:00 2026-06-07T15:18:47+00:00

Im wanting to do something along the lines of this: internal interface IInternalStore {

  • 0

Im wanting to do something along the lines of this:

internal interface IInternalStore
{
    object GetValue(object key);
}

public interface IStore<in TKey, TValue>
    : IInternalStore
{
    TValue GetValue(TKey key);
}

public interface IStore
    : IInternalStore
{
    TValue GetValue<in TKey, TValue>(TKey key);
}

The reason i want to do this is so that i can check that the class is an IInternalStore without having to check for the individual interface types.

IE.

// Defined by the implementing developer
public class MyStoreA
    : IStore<int, int>
{
    int GetValue(int key);
}

public class MyStoreB<TKey, TValue>
    : IStore
{
    TValue GetValue(TKey key);
}

// Internal method used by me
void GetValueFromStore(object store)
{
    if (store is IInternalStore)
    {
       {do something}
    }
}

but from what I can see, what i want to do is not possible as the IInternalStore must be of the same accessor as the inherited interfaces and it would require the developer to implement all the inherited methods.

Am i wrong? Is there a way to do what im wanting?

  • 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-07T15:18:49+00:00Added an answer on June 7, 2026 at 3:18 pm

    Am i wrong? Is there a way to do what im wanting?

    No, you’re right – a public interface can’t extend an internal one.

    I suggest you just separate the two interfaces. You can always then have an internal interface which extends both, if you want, or just make the relevant classes implement both classes.

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

Sidebar

Related Questions

I have a control that looks along the lines of this: public class MyControl
I'm wanting to do something like this: priority_queue< pair<int, int>, vector<int>, greater<int> > Q;
Ok, I am wanting to do something like this: $which = !empty($param_id) ? ['groups'][$param_id]
I am wanting something similar to this person , except the element I want
I have a simple server that looks something like this: void *run_thread(void *arg) {
I was wondering if there was any function along the lines of IsBufferEmpty() to
I'm wanting to do something like SELECT t.subtitle FROM temp t LEFT JOIN ep
I am working in java and wanting to use something like output parameters. Here
I'm wanting to do something like the following: ... pixel[0,0] = [ 254, 0,
Wanting to give byobu a looksee as a screen 'update' of sorts. I start

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.