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

The Archive Base Latest Questions

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

Hy, i know it sounds a very stupid question. Here’s what i found: public

  • 0

Hy,
i know it sounds a very stupid question.
Here’s what i found:

public static List<SomeDTO> GetData(Guid userId, int languageId)
 {
 // Do something here
 }

    public static List<int> GetData(Guid userId ,int iNumberOfItems)
    {
      var result = GetData(userID,0);

     return  (from r in result select c.id).Take(iNumberOfItems).ToList<int>();
    }

I get a compilation error:

ClassLibrary’ already defines a member called ‘GetData’ with the same parameter types

The second only returning the ids of the first function.

I know this isn’t working.
I know there’s both returning a List<> type ,but they returning differentypes.
Could somebody explain me why?
How can i solve this?

Update This problem is solved on F# !

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

    You can’t override based on the return-type. If you look at your method signature, it looks like the following:

    public static List<SomeDTO> GetData(Guid, int)
    

    and

    public static List<int> GetData(Guid, int)
    

    What you need to do is one of the following:

    • Change the method names to something clearer.
    • Make sure that the parameters can identify which method to call

    Now, when you call your function, the return type isn’t specified. And since the parameters look the same, the compiler doesn’t know which function to call. But it doesn’t need to make a guess, since the signatures are too similar it complains on compilation.

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

Sidebar

Related Questions

I know this question is going to sound very stupid but here goes nonetheless.
I know it sounds very basic, but I am new to Javascript. Here is
I know it probably sounds like very trivial question but I couldn't find any
I know this sounds very stupid indeed, but I find mysqli prepared statements and
I know this question sounds very basic. But I can't find it using Google.
I know it sounds and actually is stupid. I am trying to promote my
I know this sounds like a dumb question but I need to ask this.
I know this sounds like a broad question but I can narrow it down
Please pardon me if my question sounds very basic. I am working on a
I know that might sound like a stupid question since it's a trivial feature

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.