C# - MyClass.MyProperty[something]
I want to do something but not sure how to describe it. I have this class

    public class Company {
      private List<Person> _persons;
      private Person GetPersonByName(string name) {
        // My code to select Person is here, which is fine
      }
    }

But I want to be able to do this

    Company c;
    Person p = c.Persons["John"];

which should implicitly call GetPersonByName("John").

Is that possible? What do I need to add to the Company class?

Thanks in advance!

C# - MyClass.MyProperty[something]
===

I want to do something but not sure how to describe it. I have this class

    public class Company {
      private List<Person> _persons;
      private Person GetPersonByName(string name) {
        // My code to select Person is here, which is fine
      }
    }

But I want to be able to do this

    Company c;
    Person p = c.Persons["John"];

which should implicitly call GetPersonByName("John").

Is that possible? What do I need to add to the Company class?

Thanks in advance!
