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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T03:26:29+00:00 2026-06-01T03:26:29+00:00

I have an interface in some referenced third-party assembly, such as: public interface ITextHandler

  • 0

I have an interface in some referenced third-party assembly, such as:

public interface ITextHandler
{
  void Handle(string text)
}

And in my own project, I take on specific meaning by inheriting this into my own interface:

public interface INameHandler : ITextHandler
{
}

When using a tool like ReSharper, I might start off with:

public class Foo : INameHandler
{
}

Resharper will show an error I can click on and “Implement Interfaces”. The result yields:

public class Foo : INameHandler
{
  public void Handle(string text)
  {
  }
}

Is there any way to tell ReSharper that I want to rename the parameter to be more specific? I’d like it to implement “name” instead of “text”:

public class Foo : INameHandler
{
  public void Handle(string name)
  {
  }
}

Is there a resharper comment or something I can add to INameHandler that redefines the default parameter name?

  • 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-01T03:26:31+00:00Added an answer on June 1, 2026 at 3:26 am

    I would suggest that you don’t do this. Indeed, just last night I ended up going to some effort to put my parameter names back to the one declared in the interface (I suspect I changed my mind in the interface later).

    Consider this code:

    Foo handler = new Foo();
    handler.Handle(name: "Hello");
    

    Now consider this harmless-looking refactoring, on the grounds of preferring to declare a variable via the interface type instead of the concrete type:

    INameHandler handler = new Foo();
    handler.Handle(name: "Hello");
    

    If your parameter names are different, you’ll get a compile-time error. It can be worse than this – you could end up with code that compiles but changes meaning if you reorder existing parameter names. Nasty, nasty stuff.

    I’m not saying this will happen – but it’s a good reason (IMO) to be careful when choosing parameter names, particularly in interfaces, and sticking with those names in implementations.

    (Hmmm… maybe I ought to write a little tool to find all violations of that… could be handy.)

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

Sidebar

Related Questions

Currently i have some interfaces (stripped down for here): public interface IJobGroup { string
I have an interface, and some classes that inherit from it. public interface IFoo
I have a third-party .NET library that enables output of some key diagnostic information
I have a interface that defines some methods with attributes. These attributes need to
I have an interface that defines some methods I would like certain classes to
I have an Interface called IStep that can do some computation (See Execution in
Some SONY Cameras have a FireWire interface. Is it possible to control any camera
I have some code using libxml2's SAX2 interface. I want to be able to
I have some problems sending mails through SMTP using Spring's MailSender interface and the
I have developed some classes with similar behavior, they all implement the same interface.

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.