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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T00:47:53+00:00 2026-06-11T00:47:53+00:00

I have two items in my class: One is a public property, and the

  • 0

I have two items in my class: One is a public property, and the other is a static method that takes a parameter.

I really do not understand why Visual Studio 2010 is unable to see the difference between these two items.

Could someone explain this one to me?

Here is the code:

public bool IsShipped {
  get {
    #region ' Test Code '
    if (!String.IsNullOrEmpty(TrailerNo) || (TruckDate != Global.NODATE)) {
      return true;
    }
    #endregion
    return false;
  }
}

public static bool IsShipped(string boxNumber) {
  var array = GetCrate(boxNumber);
  if (array != null) {
    foreach (var item in array) {
      if (item.IsShipped) {
        return true;
      }
    }
  }
  return false;
}

Here is the error:

Error 1 Ambiguity between ‘AcpClasses.AcpPackNShip.IsShipped’ and ‘AcpClasses.AcpPackNShip.IsShipped(string)’ C:\Users\cp-jpool\My Projects\VS\Live\Common\Classes\AcpPackShip.cs 242 20 CoilPC

screenshot

  • 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-11T00:47:55+00:00Added an answer on June 11, 2026 at 12:47 am

    It’s possible to refer to a method as a delegate, not just by calling it. For example, the following could would be valid use of the method:

    Func<string, bool> myFunction = item.IsShipped;
    

    Given that the method doesn’t need to be actually called with parenthesis, there is no way of determining if item.IsShipped is supposed to refer to the method group for IsShipped or to be the property IsShipped.

    Even if it were allowed, it would be a point likely to result in confusion. It would be preferable from a code maintenance perspective to have different names for the property/method, even if the compiler were somehow smart enough to know which one to use when (or worse, if it just picked one arbitrarily).

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

Sidebar

Related Questions

If I have two objects, one being the list of items, and the other
I have two tabbar items(views) that use the same data, whats the best solution
I have a list that has two items: projects and groups. Projects can go
I have two tables, one called cart and one called items. Now I want
Say I have two lists: List<CanidateSkill> canidateSkills; List<JobDesiredSkill> desiredSkills; class CanidateSkill { public Guid
I'm using Hibernate (3.3.x) and I have two entities: public class FtChargeAcctPkgDtl { private
I have an application that can display items in two different ways, in rows
CodeIgniter 2.1.2 I have a class that contains two methods, for the purpose of
I have two entity that has an one-to-many relationship, I´m trying to select the
I have two generic Lists, one called Featured and the other called Filtered. List<Content>

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.