Getter property with arguments

To answer the question: No, it is not possible, and as already pointed out, a getter with a parameter would look just like a method.

The thing you are thinking about might be an indexed default property, which looks like this:

class Test
{
    public string this[int index] 
    {
        get { return index.ToString(); } 
    }
}

This allows you to index into an instance of Test, like this:

Test t = new Test();
string value = t[1];

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)