using System;
public class Program
{
class Foobar
public string bla
get;
set;
}
public Foobar()
this.bla = "hello world";
public string this[string name]
get
return this.GetType().GetProperty(name).GetValue(this, null).ToString();
public static void Main()
Foobar x = new Foobar();
Console.WriteLine(x.bla); //this works
Console.WriteLine(x["bla"]); //this wont work but is my achivment