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

  • Home
  • SEARCH
  • 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 6320305
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T15:56:50+00:00 2026-05-24T15:56:50+00:00

I have created an interface as shown below. The DTO object is a complex

  • 0

I have created an interface as shown below. The DTO object is a complex value object with 3 parameters.

public interface IOperation
{
    DTO Operate(DTO ArchiveAndPurgeDTO);
}

I need people that impliment this interface to be able to inherit from the original Value object and extend it where required.

My assumption was that they could simply inherit the DTO object, add (for example) another property and use it in the same class that impliments this interface.

When I try to use the extended value object, Visual Studio complains that I am no longer implimenting the interface.

How can I impliment this functionality.

Thanks in advance for any ideas, and/or suggestions.

Gineer

Edit:
DTO Code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Company.ArchiveAndPurge
{
    public class DTO
    {
        public DTO(String FriendlyID)
        {
            friendlyId = FriendlyID;
        }

        private String friendlyId = String.Empty;

        public String FriendlyId 
        { 
            get { return friendlyId; }
            set { friendlyId = value; } 
        }

        private String internalId = String.Empty;

        public String InternalyId
        {
            get { return internalId; }
            set { internalId = value; }
        }

        private Boolean archivedSuccessfully = false;

        public Boolean ArchivedSuccessfully
        {
            get { return archivedSuccessfully; }
            set { archivedSuccessfully = value; }
        }
    }
}

Extended DTO:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Company.MSO.ArchiveAndPurge
{
    public class DTO: Company.ArchiveAndPurge.DTO
    {
        private Boolean requiresArchiving = true;

        public Boolean RequiresArchiving
        {
            get { return requiresArchiving; }
            set { requiresArchiving = value; }
        }
    }
}

Interface Implementation where VS Complains:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Company.ArchiveAndPurge.Contracts;
using Company.ArchiveAndPurge;

namespace Company.MSO.ArchiveAndPurge
{
    public class ResolveFriendlyId: IOperation
    {
        #region IOperation Members

        public DTO Operate(DTO ArchiveAndPurgeDTO)
        {
            ArchiveAndPurgeDTO.InternalyId = ArchiveAndPurgeDTO.FriendlyId;
            return ArchiveAndPurgeDTO;
        }

        #endregion
    }
}
  • 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-24T15:56:52+00:00Added an answer on May 24, 2026 at 3:56 pm

    As I understand it, you probably had something like:

    public class ExtendedOperation : IOperation
    {
        public ExtendedDTO Operate(ExtendedDTO dto)
        {
            ...
        }
    }
    

    That doesn’t work in two ways:

    • You can’t change the return type when implementing an interface method
    • You can’t change the parameter list when implementing an interface

    In particular, you wouldn’t be implementing IOperation in a way which would be compatible with code like this:

    IOperation operation = new ExtendedOperation();
    operation.Operate(new DTO());
    

    I suspect you might want to make the interface generic:

    public interface IOperation<T> where T : DTO
    {
        T Operate(T dto);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple 'Service' system set up with an interface as shown below.
I have created an interface using jQuery UI Tabs, however one of my requirements
alt text http://home.elka.pw.edu.pl/~pkolodzi/Capture.PNG I have created the IAdder interface with two methods: PassA and
I have created a schema as an agreed upon interface between our company and
Suppose I have created a UIView , MyView , in Interface Builder, and I
I have a Tab Bar Controller created in Interface Builder Within the Tab Bar
A lot of JavaScript libraries have user interface widgets. Usually they are created after
I have an C++ application (heavily shortened down, shown below); #include <iostream> #include MyClass.h
I'm having a brain cramp: I have a public interface SomeInterface and a static
I have created a nice user interface, and I would like to add some

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.