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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T22:09:21+00:00 2026-05-24T22:09:21+00:00

I am making fairly extensive and ongoing modifications to a third party product for

  • 0

I am making fairly extensive and ongoing modifications to a third party product for my employer. One of the major considerations when implementing my code has been to segregate it as much as possible to make the integration of changes from the vendor to be as painless as possible. Thus far, one of the most useful tools to accomplish this has been the partial class. Using partial classes I am able to keep any new methods that I have to implement in their own file.

But today I hit a hiccup that I need to address some how. Let’s say I need to extend the following interface.

public partial interface ICondition
{
  void MethodA();
  void MethodB();
}

by making the interface a partial and adding a file called ICondition.CompanyName.cs

public partial interface ICondition
{
  void MethodC();
}

now what I want to do is to implement the interface in the same way I declared it, with MethodA() and MethodB() implemented in one file of a partial class, and MethodC() in another.

public partial class Condition : ICondition
{
   public void MethodA(){ }
   public void MethodB(){ }
}

and my class Condition.CompanyName.cs

public partial class Condition : ICondition
{
   public void MethodC() { }
}

This of course doesn’t work, as the interface must be implemented all in the same file. What I am hoping is there is some declaration, or bit of syntax magic that I am unaware of that will allow me to do what I want to do, and keep these methods in separate files, but the same interface.

Edit

This does in fact work, my issue was that I had my 2 partial classes in different namespaces due to a silly typo. I got started a little too early this morning I suppose, thanks everyone for your time and attention.

  • 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-24T22:09:22+00:00Added an answer on May 24, 2026 at 10:09 pm

    You don’t need to have a partial interface in this instance, you should still be able to put the methods where you want.

    This of course doesn’t work, as the interface must be implemented all
    in the same file

    I don’t see how your example doesn’t work, I just did the following:

    partial interface IFoo
    {
        void One();
        void Two();
    }
    
    partial class Class1 : IFoo
    {
        public void Two()
        { }
    
        public void Three()
        { }
    }
    

    In one file.

    partial interface IFoo
    {
        void Three();
    }
    
    partial class Class1 : IFoo
    {
        public void One()
        { }
    }
    

    In another…

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

Sidebar

Related Questions

Just some pointers here. I am making fairly extensive modifications to a site, including
I'm making some fairly basic shapes in OpenGL-ES based on sample code from Apple.
I have been making a button which (hopefully) looks fairly realistic. One part of
I've been making the valiant attempt to grok the doom 3 source code. One
I'm relatively new to java (specifically swing) and have recently been making some fairly
I am thinking about making a website with some fairly intense JavaScript/canvas usage and
I'm fairly new to C# programming. I am making a program for fun that
I am making a webapp. I have a fairly basic question about javascript performance.
My problem doesn't seem like a unique one. Basically I have a fairly expensive
If there are any DBAs out there, I'm making a fairly large piece of

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.