I want to avoid duplicated code. At the moment I iterate over certain "options" and then based on the option I calculate a value. The code looks something like this:

```
if (option == "A")
    result = (y[0].A - y[1].A) / (x[0].A - x[1].A);

if (option == "B")
    result = (y[0].B - y[1].B) / (x[0].B - x[1].B);

if (option == "C")
    result = (y[0].C - y[1].C) / (x[0].C - x[1].C);

```

It is doing the same for A,B and C - is there a way to use the string "option" to select the desired property (A,B,C) of x and y?

> 
> x,y is Dictionary<int, class>, and this class has the properties A,B,C which are doubles
> 
> 
>