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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T02:57:25+00:00 2026-06-11T02:57:25+00:00

Background: I’m not sure exactly how to phrase this question, so this is the

  • 0

Background:

I’m not sure exactly how to phrase this question, so this is the example of what I’m trying to achieve:

public interface IEverythingVM : IA, IB
{
    MyTypeA {get;}
    MyTypeB {get;}
    MyTypeC {get;}

    MyTypeD {get;}
    MyTypeE {get;}
    MyTypeF {get;}
}

public class EverythingVM : IEverythingVM
{
    // Populate everything from MyTypeA to MyTypeF
}

public interface IA
{
    MyTypeA {get;}
    MyTypeB {get;}
    MyTypeC {get;}
}


public interface IB
{
    MyTypeD {get;}
    MyTypeE {get;}
    MyTypeF {get;}
}

Realisation:

I was under the impression that I could do something like the following, but having written it out, it’s planely apparent why it won’t work – I’m trying to take something big, debigulate it and then rebigulate it, which is a concept so ridiculous it makes me want to laugh out loud and chortle.

{
    IA varIA = new EverythingVM(param1, param2);
    IB varIB = new EverythingVM(param1, param2);

    var cm = new ComparisonManager(varIA, varIB);        
}

public class ComparisonManager
{
    public ComparisonManager(IEverythingVM varEIA, IEverythingVM varEIB)
    {
        // be able to acces MyTypeA, MyTypeB & MyTypeC from varEIA
        // be able to acces MyTypeD, MyTypeE & MyTypeF from varEIB
    }
}

Question:

Ultimately what I’m trying to achieve is that in some cases I want MyTypeA, MyTypeB & MyTypeC available in ComparisonManager, and in other cases I want MyTypeD, MyTypeE & MyTypeF available in ComparisonManager. Is there any way for me to achieve this given the current structure?

  • 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-11T02:57:26+00:00Added an answer on June 11, 2026 at 2:57 am

    it turns out the solution was to:

    public class ComparisonManager<T>
    {
        private readonly T _diskServiceVm;
        private readonly T _panelServiceVm;
    
        public ComparisonManager(T diskServiceVm, T panelServiceVm)
        {
            _diskServiceVm = diskServiceVm;
            _panelServiceVm = panelServiceVm;
        }
    }
    

    Implementation:

    if (/* circumstance A */)
    {
        IA varIA = new A(varA, varB);
        IA varIB = new B(varA, varB);
    
        // this knows how to deal with MyTypeA, MyTypeB & MyTypeC
        var comparisonManager = new ComparisonManager<IA>(varIA , varIB);
    }
    else
    {
        IB varIA = new A(varA, varB);
        IB varIB = new B(varA, varB);
    
        // this knows how to deal with MyTypeD, MyTypeE & MyTypeF
        var comparisonManager = new ComparisonManager<IB>(varIA , varIB);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Background I'm trying to implement a simple web server part as a web interface
Background : I'm trying to convert some JavaScript code which uses the the Crossfilter
Background: I'm testing a function within an ASP.NET 4.0 (Web Forms not MVC) and
Background info I am trying to upgrade a custom CMS to support the HTML5
Background I have an installation of VisualSVN on a server. under this, I have
Background Hi All, I'm trying to use Boost::MPI, at the moment I'm just trying
Background info: Me and a couple of friends are building this platform game in
Background: I have a website where people can store transactions. As part of this
Background I once wrote this method: private <T> SortedSet<T> createSortedSet() { return new TreeSet<T>();
Background This is only my second PyQt4 project. Developing a Windows app that has

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.